0

I have two different collections- test1 and test3 in SolrCloud. When I search for "BUG-123" in test1 I see following parsed query in debug section.

"debug": {
    "rawquerystring": "\"BUG-123\"",
    "querystring": "\"BUG-123\"",
    "parsedquery": "PhraseQuery(_text_:\"bug 123\")",
    "parsedquery_toString": "_text_:\"bug 123\"",
...}

Whereas When I search for "BUG-123" in test3 I see following parsed query in debug section.

"debug": {
    "rawquerystring": "\"BUG-123\"",
    "querystring": "\"BUG-123\"",
    "parsedquery": "PhraseQuery(_text_:\"bug ? 123\")",
    "parsedquery_toString": "_text_:\"bug ? 123\"",
...}

Please note in case of test3 , "-" character gets replaced with "?". Due to this I do not get any documents in search result.

I need help to understand why - gets replaced with ? and how to avoid it.

Shubhangi
  • 131
  • 1

1 Answers1

0

I could resolve this issue. In managed-schema file for test3 collection, I had included AutoPhrasingTokenFilterFactory in query section for text_en field type, as follows

    <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" words="lang/stopwords_en.txt" ignoreCase="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/>
<filter class="solr.StopFilterFactory" words="lang/stopwords_en.txt" ignoreCase="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
<filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
<filter class="com.lucidworks.analysis.AutoPhrasingTokenFilterFactory" includeTokens="true" phrases="autophrases.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>

Removing following line and restarting solr cloud resolved issue.

<filter class="com.lucidworks.analysis.AutoPhrasingTokenFilterFactory" includeTokens="true" phrases="autophrases.txt"/>
Shubhangi
  • 131
  • 1