Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12340

Solr 7 does not do a phrase search by default for certain queries.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.2
    • Fix Version/s: None
    • Component/s: SolrJ
    • Labels:
      None
    • Environment:

      windows 7 x64 

      solr-spec 5.2.1
      lucene-spec 5.2.1
      java.runtime.version 1.8.0_112-b15
      jetty.version 9.3.8.v20160314

      solr-spec 7.2.1
      lucene-impl 7.2.1
      java.version 9.0.4
      jetty.version 9.3.8.v20160314

      Description

      we have recently upgraded from Solr5 to Solr7. I'm running into a change of behavior detailed below:

      For the term "test3" Solr7 splits the numeric and alphabetical components and does a simple term search while Solr 5 did a phrase search.

      -------------------------------------------------------------------------------------------------------

      lucene/solr-spec: 7.2.1

      http://localhost:8991/solr/solr4/select?q=test3&fq=test&wt=json&indent=true&debugQuery=true

       

      "debug":{

          "rawquerystring":"test3",

          "querystring":"test3",

          "parsedquery":"contents:test contents:3",

          "parsedquery_toString":"contents:test contents:3",

       

      -----------------------------------------------------------------------------------------------------------

      lucene/solr-spec 5.2.1

      http://localhost:8989/solr/solr4/select?q=test3&fq=test&wt=json&indent=true&debugQuery=true

       

      "debug":{

          "rawquerystring":"test3",

          "querystring":"test3",

          "parsedquery":"PhraseQuery(contents:\"test 3\")",

          "parsedquery_toString":"contents:\"test 3\"",

      ----------------------------------------------------------------------------------------------------------------

      passing "sow=true" in the URL for Solr 7 makes it behave like 5.

      The schema.xml in both Solr versions for me is the one that gets copied from the default template folder to the collections's conf folder.

      The fieldtype that corresponds to field "contents" is "text", and the definition of "text" field in 5 and the schema backup on 7 is the same.

       

      I tried the analysis tab. Looks like all the classes (WT, SF ...) in 7 list a property (termFrequency = 1) that is missing in 5.

      attaching the schema for Solr 5 and 7.

       

       

        Attachments

        1. managed-schema-solr7
          15 kB
          piyush nayak
        2. schema-solr5.xml
          28 kB
          piyush nayak

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              piyushn piyush nayak
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: