1 person found this helpful
The two pieces to this puzzle are searching your database with a string search parameter, and, getting query results to offer autosuggest selections.
I suggest that you start by reading the documentation on the autosuggest attributes of cfinput and get that to work with a very simple list. Then see what sort of query you can write. You know your database better than any of us.
Thanks Dan. I like the way you parsed the problem. That's what I needed...
I've explored the basics - a cfinput tag bound to a cfc that contains a query and returns JSON. It makes sense to me and I have that working on a single text-box interacting with a single database column. I even "get" (albeit to a lesser degree) how conceptually one text box can autosuggest for the next box.
The thing I'm unclear about is how to make a single text box more free-form...more "google-esque" if you will where the user input can be less structured. Does this only exist for search giants with an army of engineers or are there pieces an individual can cobble together to get a similar result.
I don't understand what you mean by making a single text box more free-form.
Sorry I was unclear.
Google is a single text box. If you type "coldfusion 9 new features"
you get a good listing of your results without having one box for
somewhat similar results typing in "new features coldfusion 9" or
"coldfusion 9 features". So for my wine app I just want to present the
user with one box so they can type in "Caymus 2005 Cabernet Sauvignon"
(a "specific" search) or "2005" (a search for all wines from that year),
etc. It's the cleanness of the user experience I'm trying to
accommodate here. Make sense?
That's the first piece of the puzzle I mentioned - writing a query that takes a single input parameter and does stuff with it. Something like
field1 like '%variable%'
or field2 like '%variable%'