Search code examples
solr

Solr Search Issue


We are storing a large number of tweets and blogs feeds into Solr.

Now if the user searches for Twitter mentions like @rohit, records which just contain the word rohit are also being returned. Even if we do an exact match "@rohit", I understand this happens because of use of WordDelimiterFilterFactory which splits on special charaters.

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory

How can I force Solr to not return without "@"? I don't want to remove the WordDelimiterFilterFactory, since the splitOnCaseChange and stemEnglishPossessive are helpful.


Solution

  • If you set preserveOriginal="1" this problem should be fixed. If not your tokenizer might strip the @, so you have to chose another one like, solr.WhitespaceTokenizerFactory.