You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Andrew Clark <an...@gmail.com> on 2011/10/21 00:00:31 UTC

Stop fuzzy search

Hi,

A Solr search for "request" gives me hits on documents containing
"requests", "requesting", and "requester". How can I turn this feature off
so Solr will return only those documents containing "request"?

Thanks,
Andrew

Re: Stop fuzzy search

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Andrew,

What you see is the result of stemming.  In Solr, certain types of fields get stemmed (e.g. text), while some do not (e.g. string, which doesn't even get analyzed).
To turn off stemming, create a new field type in schema.xml and make sure not to specify any sort of stemming factory in it.
e.g.

    <fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
      <analyzer>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt"/>
        <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
        <!-- <filter class="solr.EnglishMinimalStemFilterFactory"/> -->
        <!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
             possible with WordDelimiterFilter in conjuncton with stemming. -->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>


Otis
----

Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/


>________________________________
>From: Andrew Clark <an...@gmail.com>
>To: solr-user@lucene.apache.org
>Sent: Thursday, October 20, 2011 6:00 PM
>Subject: Stop fuzzy search
>
>Hi,
>
>A Solr search for "request" gives me hits on documents containing
>"requests", "requesting", and "requester". How can I turn this feature off
>so Solr will return only those documents containing "request"?
>
>Thanks,
>Andrew
>
>
>