1

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:

  • harry potter
  • harry potter in Books
  • harry potter in Movies & TV

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.

DelphiLynx
  • 911
  • 1
  • 16
  • 41
  • 3
    Do some searching around 'full text search' and 'fuzzy matching search' - they should help you. What language are you using (please tag accordingly)? – halfer Jun 13 '12 at 14:55
  • Possible dup of [this](http://stackoverflow.com/questions/3208743/php-fuzzy-search-matching)? – halfer Jun 13 '12 at 14:57
  • @halfer, Thanks for your suggestion about full text search. It seems the way to go. Question left, does Amazon use full text searching with the MySQL MATCH() function or something more sophisticated? – DelphiLynx Jun 13 '12 at 16:43
  • I don't think it's possible to answer that, unless someone from Amazon were to see your question (speculation about what technology company X uses is probably O/T here). That said I should think that would be too simplistic for their needs. You could always try searching for "Amazon full text search" to see if their techs have done presentations on the topic. – halfer Jun 13 '12 at 16:59

1 Answers1

1

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)

symcbean
  • 47,736
  • 6
  • 59
  • 94
  • Thanks for your reply, however what you list is unfortunately not my problem. 'Full text search' mentioned by halfer seems to be the solution. I go to research it. – DelphiLynx Jun 13 '12 at 16:41
  • 1
    MySQL's FULLTEXT search is very, VERY limited - go research how to do a proper keyword search. – symcbean Jun 14 '12 at 11:16