0

I looking for a way to configure Solr so that it only finds exact matches for a particular word and works the normal way for other words.

One possible way that comes to mind is to configure the stemmer's synonyms list so that this word is mapped to a particular special codeword that is unlikely to be encountered otherwise.

Is there a better way of achieving this?

The search is for an automotive site and the word man means the trunk maker to them so I want to constraint matches strictly to whole word matches for this word.

Example Document 1: "MAN trucks"
Document 2: "Mans Manual Transmission"
Query: "truck" should match Document 1
Query: "trucks" should match Document 1
Query: "manuals" should match document 2
Query: "man" should only match document 1

axk
  • 5,316
  • 12
  • 58
  • 96

1 Answers1

1

I do not have direct answer for this, but this might help you stemming + synonym handling in solr. http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#SynonymFilter

http://search-lucene.com/m/hg9ri2mDvGk1

In summary you need to use stemming in most cases, but in case of man vs mans you need to tell that they are different and do not stem.

Arun
  • 1,777
  • 10
  • 11