Reputation: 1256
I am building a search where I need to implement couple of features in it among others.
1- It should bring all synonyms, like if someone searches for couch, it should bring in matching results for that couch plus linguistic matches like (sofas, cushions etc). To accomplish that I am using Full Text Search.
In my query I use FreeText but it does not yield the required results. That's what I do,
select * from Furn_Products Where FreeText(FurnName, 'Couch');
It should bring Names containing Cushions, Sofa and Couch off course but it only brings Names with Couch which I could also do by simple Like query. Any solutions?
2- I need to check for typos, like if someone types soofa
, it should bring in results for sofa, couch etc.
Any tips, ideas on how to achieve this? Thanks in advance.
Upvotes: 2
Views: 281
Reputation: 668
I agree with Nelson, there are lots of open-source search engines already out there, and they have gone through a lot of debugging. The biggest ones are Lucene/Solr, Sphinx, and Xapian.
Also, be careful when adding synonym expansion. If you expand paddle, for example, to bat, you might get a lot of zoological results you don't want. If you're doing automated queries. find some examples and set up a test suite with corner cases. If you expect to have human users, find a couple who will walk you through their processes to help build your test suite, and plan to get very friendly with the search logs. Best of luck!
Upvotes: 1
Reputation: 9746
As far as I know, Full Text Search doesn't give you access to all the possible words (stemming, etc.). But starting with SQL Server 2008 you can get a list of all the indexed words.
For more features you would probably have to go with a 3rd party indexer like Lucene.
Upvotes: 0