Yirmiyahu Fischer
Yirmiyahu Fischer

Reputation: 623

migrating from Solr 5.2 to Solr 8.2 -- query using edismax not yielding results

I am trying the following query from solr:

    http://localhost:8393/solr/core-name/select?defType=edismax&fl=product_id_i,ProductName_ten&q=cnmg+432+ud32&q.op=AND&qf=ProductName_ten_ngram

On Solr 5.2, I get one document returned with the following results:

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
<lst name="params">
<str name="fl">product_id_i,ProductName_ten</str>
<str name="q">cnmg 432 ud32</str>
<str name="qf">ProductName_ten_ngram</str>
<str name="q.op">AND</str>
<str name="defType">edismax</str>
</lst>
</lst>
<result name="response" numFound="1" start="0">
<doc>
<int name="product_id_i">1521210</int>
<str name="ProductName_ten">
CNMG 432 ZM1 UD32, 1/32″ Corner Radius, 3/16″ Thick, 1/2″ Inscribed Circle, Turning Indexable Insert
</str>
</doc>
</result>
</response>

On Solr 8.2, however, the document is not found, and I get the following results:

{
  "responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
      "q":"cnmg 432 ud32",
      "defType":"edismax",
      "qf":"ProductName_ten_ngram",
      "fl":"product_id_i,ProductName_ten",
      "q.op":"AND"}},
  "response":{"numFound":0,"start":0,"docs":[]
  }}

The schema.xml files for both systems are essentially identical, and the fields are defined as follows:

<dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
<field name="ProductName_ten_ngram" type="text_gen_text_only_ngram" indexed="true" stored="false" multiValued="false"/>
<dynamicField name="*_ten"  type="text_en"    indexed="true"  stored="true" />
<fieldType name="text_gen_text_only_ngram" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.PatternReplaceFilterFactory" pattern="[^a-z0-9.\/]" replacement="" replace="all" />
        <filter class="solr.ShingleFilterFactory" minShingleSize="2" maxShingleSize="2" outputUnigrams="true" outputUnigramsIfNoShingles="true" tokenSeparator="-"/>
        <filter class="solr.NGramFilterFactory" minGramSize="1" maxGramSize="15" />
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.PatternReplaceFilterFactory" pattern="[^a-z0-9.\/]" replacement="" replace="all" />
        <filter class="solr.ShingleFilterFactory" minShingleSize="2" maxShingleSize="2" outputUnigrams="false" outputUnigramsIfNoShingles="true" tokenSeparator="-"/>
      </analyzer>
   </fieldType>

<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <!-- Case insensitive stop word removal.
        -->
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="lang/stopwords_en.txt"
                />
        <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
    <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
        <filter class="solr.EnglishMinimalStemFilterFactory"/>
    -->
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.ManagedStopFilterFactory" managed="english" />
        <filter class="solr.ManagedSynonymGraphFilterFactory" managed="english" />
        <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.EnglishPossessiveFilterFactory"/>
        <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
    <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory:
        <filter class="solr.EnglishMinimalStemFilterFactory"/>
    -->
        <filter class="solr.PorterStemFilterFactory"/>
      </analyzer>
    </fieldType>

<copyField source="ProductName_ten" dest="ProductName_ten_ngram"/>

The question is -- why are results that are returned in Solr 5.2 not returned in Solr 8.2?

Upvotes: 0

Views: 97

Answers (1)

Abir43
Abir43

Reputation: 1

It seems like solr 5.2 and solr 8.2 reads the schema differently and there is a conflict with the explicit field name = 'text_gen_text_only_ngram' and the dynamic field name = 'text_en_ngram' analyzer

Upvotes: 0

Related Questions