Hello,

I am trying to achieve searching with a phrase in SOLR. Specifically I have
the following field in my schema:

   <field name="search_field" type="phrase_search" indexed="true"
stored="false" multiValued="true"/>

    <fieldType name=" phrase_search" class="solr.TextField"
positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" enablePositionIncrements="true" />
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>

Also (as a second similar problem) in the “synonyms.txt” I have values like
these:

aword => a whole phrase

and I even tried:

aword => "a whole phrase"

now I tried searching for “check this” in several ways:

fq=search_field:check this
fq=search_field:check+this
fq=search_field:"check this"
fq=search_field:'check this'

but in all cases the search seems to run for “check OR this”!

similarly, if I search for “aword” which matches the synonyms file, the
search also looks for “a OR whole OR phrase”.

What am I doing wrong? Is there any way to force the query for the whole
phrase and not for each word separately?




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Whole-Phrase-search-in-Solr-tp4023931.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to