Search engine with "did you mean"

Possible duplicate:
Like Google, "did you mean?" Does the algorithm work?

I have a database table with approximately 2 million records. I use mysql fulltext to search, but users very often enter bad ex gmes β†’ words should be games, so I need a library with PHP shells to have a function like google, "you mean" What should I use ?

+7
php search-engine
source share
5 answers

You can use an API like the Yahoo Spelling Suggestion , like any easy way to populate it without having to roll on your own.

+3
source share

The index is a list of words and the place where they occur. For example. games are found on lines 123 and 456. If you have such a list with all the words, you can easily find a suitable word. This way you can match gmes with games.

However, this is not possible with the provision of the MySQL index.

+1
source share

if you do not plan to rely on third-party sites, you definitely need your own levenshtein dictionary to find out how close the user's words are to dictionary terms

+1
source share

You can use the Yahoo Spelling API, etc., if your requests are very general. But if you have a domain specific dictionary, then you'd better use Apache Solr .

You can use it to index your 2MM entries, simply! And use it as a search engine with cut, etc. It also generates a spell check index from your entries, which you can use for your β€œdid you mean”? or auto suggest function. It is also extremely difficult to integrate into any language because of its RESTful API

Bottom line: if you are looking for a long-term solution that can handle several things, in addition to spell checking, for example, search / auto suggest / cut, etc. Solr is the way to go.

+1
source share

Another option would be PHP Pspell functions , in particular pspell_suggest , but you need to install the aspell library on the server.

0
source share

All Articles