tomsseisums
tomsseisums

Reputation: 13367

Search function that provides synonyms in results or provides corrections

I'll start with that I have no idea what would be the proper keywords to find this, therefore, please excuse me for, probably, misleading title and/or repeated question.

For example, when you search "potat" in google, it automaticly points you to potato. How could I achieve this in my application?

Nuance: it has to be multilingual, since application is primary oriented for non-English people.

Thanks in advance!

Edit:

Uhm, are there any alternatives or anything to Sphinx? Because it looks like on the destination server where the application will be hosted when published, they won't have it.

Upvotes: 1

Views: 1116

Answers (2)

oezi
oezi

Reputation: 51807

you could try to take a look at mysql's SOUNDS LIKE- or SOUNDEX()-syntax, it seems to improve your search results, but this isn't usable for getting some kind of "did you mean ???"-suggestions.

Upvotes: 0

pleasedontbelong
pleasedontbelong

Reputation: 20102

there's a fine library called sphinx that can be installed with mysql or it could run as a separated deamon, it includes an API for different languages (including php)

it will build indexes so 'potat','potato' and 'potatoes' would be treated as the same word.

And to do the "Did you mean.." it has an option when indexing the information that saves the list of words and their frequency on the documents, so you could as this list if no results are found

Good Luck

Upvotes: 3

Related Questions