Originally posted by William Brogden:
what is going to be searched here - a database with a controlled vocabulary or something completely open ended? There is no sense in suggesting words that are not going to lead anywhere.
Originally posted by William Brogden:
Is this for a HTML/web page or a desktop application?
Originally posted by William Brogden:
For prefix based suggestions, your best bet is simply an alphabetical array, see the java.util.Arrays class for the binary search methods to locate a starting point. I would suggest waiting until the client types at least 3 characters, otherwise the list of suggestions would be huge.
Originally posted by William Brogden:
The arbitrary character sequence - ie "ball" suggests football - is a big problem, better get the prefix working first.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Probably not, but any "wild diversions" should be considered.Originally posted by Lance Miller:
Do you think a fresh database query after each letter would be responsive enough, especially considering how fast some people type
Originally posted by Lance Miller:
Do you think a fresh database query after each letter would be responsive enough, especially considering how fast some people type
Originally posted by Garrett Rowe:
How about a Ternary Search Tree.
Originally posted by Taariq San:
How about searching after a pause in typing? A few hundred milliseconds should do.
When the customer pauses is probably when he/she's interested in your suggestions anyway.
Originally posted by William Brogden:
Exactly how many product names are we talking about here? You might be surprised at how fast Java's regex pattern matching can locate partial matches.
Originally posted by William Brogden:
PS - watch out for tying up your GUI event Thread. Searchs should run in separate Threads asynchronously.
Web Development Tips and Tutorials - By Sachin
Originally posted by Sachin Joshi:
How about a Search engine based approach. For example try Lucene search engine
...
We are doing lot of big data (more then 200GB index) searches using Lucene search engine .... and its really fast as compared to doing direct database query with multiple criteria and wild cards.....
Originally posted by Lance Miller:
I need to look at them in more detail to verify the thread isolation.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
mooooooo ..... tiny ad ....
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|