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 Mike Thomsen <mi...@gmail.com> on 2015/06/11 18:14:13 UTC

Exact phrase search not working

This is my field definition:

<fieldType name="text_en_splitting" class="solr.TextField"
positionIncrementGap="100" autoGeneratePhraseQueries="true">
    <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter
class="com.lucidworks.analysis.AutoPhrasingTokenFilterFactory"
collection="default-collection" includeTokens="true"
replaceWhitespaceWith="_"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.HunspellStemFilterFactory"
                dictionary="en_US.dic"
                affix="en_US.aff"
                ignoreCase="false"
                longestOnly="false" />
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter
class="com.lucidworks.analysis.AutoPhrasingTokenFilterFactory"
collection="default-collection" includeTokens="true"
replaceWhitespaceWith="_"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ManagedSynonymFilterFactory" managed="english"
/>
        <filter class="solr.KeywordMarkerFilterFactory"
protected="protwords.txt"/>
        <filter class="solr.HunspellStemFilterFactory"
                dictionary="en_US.dic"
                affix="en_US.aff"
                ignoreCase="false"
                longestOnly="false" />
    </analyzer>
</fieldType>

Then I query for this exact phrase (which I can see in various documents)
and get no results...

my_field: "baltimore police force"

This is the output of the debugQuery part of the result set.

"rawquerystring": "\"baltimore police force\"",
    "querystring": "\"baltimore police force\"",
    "parsedquery": "PhraseQuery(search_text:\"baltimore ? police ? ? force\")",
    "parsedquery_toString": "search_text:\"baltimore ? police ? ? force\"",
    "QParser": "LuceneQParser",

Thanks,

Mike