Reputation: 921
This question may seem naive. I don't want to reach the power of this big company with me alone.
The question: when you go to http://www.amazon.com try to search for "harry potter" but instead type: "hary poter".
You will see a result like:
And the question is, I have a huge MySQL database with products. How to implement such a search result on it?
I know Apache Lucene, but I want to know if there are simpler approaches.
Upvotes: 1
Views: 649
Reputation: 48357
1) record search terms submitted / use your current database - resturucture the data to optimize keyword searches
2) add an onkeyup handler to send an Ajax request serverside (but use a mutex so you only have one call outstanding at a time)
3) serverside do a keyword lookup against the data from 1 and return the matchnig data
4) when the ajax call returns add the rows as a clickable entries in a div in a new layer
What's so difficult about that? You can use any type of database you like. You can use any serverside programming language you like. Browserside you should probably stick to javascript.
(If you want someone to write the code for you, then you'll probably need to pay them)
Upvotes: 1