1

No answers existing on the web so far, I am counting on your expertise for this challenge:

I'd need my search results (on product title) to be ranked considering the order of keywords typed by user.

Ex: user types in the search field: digital camera canon 123

Desired ranking should be:

  1. digital camera canon 123
  2. digital camera canon 123 ABC
  3. digital camera canon 123A
  4. digital camera canonying
  5. digital camera sony
  6. digital videocamera
  7. camera canon 123A
  8. camera canon
  9. 123
  10. cameramen 1234
  11. canonying

Do you have a clue how the MYSQL query could do that?

filtering stop words is a nice to have feature.....

thanks a lot!

2 Answers2

1

Have you tried FULL TEXT INDEX?

http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.html

Miroslav
  • 1,960
  • 1
  • 13
  • 26
  • actually I dont want counting occurences to be a criteria for ranking as Full-text does apparently. So: digital digital camera camera is not more important than digital camera. Does it make sense? – user1617194 Aug 22 '12 at 15:48
0

Although you could probably do this with MySQL with some hacks I would seriously advise against it.

If you want to get good and fast search results with lots of tuning options than I would strongly recommend using Solr or Sphinx


Having that said, here are the real answers to your questions:

Searching for a specific word order: MySQL Fulltext with particular word order

Filtering stopwords is fairly easy to do with: http://dev.mysql.com/doc/refman/5.5/en/fulltext-stopwords.html

Community
  • 1
  • 1
Wolph
  • 78,177
  • 11
  • 137
  • 148