We are currently replacing our product search from mysql to a SOLR backend. Our customer often search for terms like 'startrek online', 'starwars', 'redsteel' or even 'grandtheftauto'. Is there a method in SOLR to either expand or spellcheck these searches into syllables eg.'star trek online', 'star wars', 'red steel', 'grand theft auto'?
+2
A:
You can use a synonym file. Take a look into this documenation site (solr.SynonymFilterFactory):
<fieldtype name="syn" class="solr.TextField">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="syn.txt" ignoreCase="true" expand="false"/>
</analyzer>
</fieldtype>
For the searchquery splitting the WordDelimiterFilterFactory could match partially your needs, but maybe the synomymfilter is easier and better (+ probably faster).
Karussell
2010-03-18 11:36:06
I was hoping for a more genric solution than the synonym file. But I will give the LetterDelimitedFilterFactory a try.
Joost Moesker
2010-03-19 10:30:22
you could try to ask this on the mailing list. Maybe there are hacks or patches for this scenario.
Karussell
2010-03-19 17:49:24
A:
You can try modifying your search terms using Levenshtein but also making use of SoundEx / Metaphone to improve matches.
http://web.elctech.com/2008/04/13/advanced-solr-filters-with-phonetics/
http://web.elctech.com/2009/07/06/solr-vs-sphinx-fuzzy-search/
Greg K
2010-03-18 11:41:37