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

Some conditional clauses on unindexed field will be ignored by query parser in some specific cases

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 7.3, 7.4, 7.5, 7.6, 7.7, 8.0, 8.1, 8.2, 8.3, 8.4
    • Fix Version/s: 7.3, 7.4, 7.5, 7.6, 7.7, 8.0, 8.1, 8.2, 8.3, 8.4
    • Component/s: query parsers
    • Labels:
    • Environment:

      Solr 7.3.1 

      centos7.5

      Description

      In some specific cases, some conditional clauses on unindexed field will be ignored

      • for query like, q=A:1 OR B:1 OR A:2 OR B:2
        if field B is not indexed(but docValues="true"), "B:1" will be lost.
         
      • but if you write query like, q=A:1 OR A:2 OR B:1 OR B:2,
        it will work perfect.

      the only difference of two queries is that they are wrote in different orders.
      one is ABAB, another is AABB.

       

      steps of reproduce
      you can easily reproduce this problem on a solr collection with _default configset and exampledocs/books.csv data.

      1. create a _default collection
        bin/solr create -c books -s 2 -rf 2
      2. post books.csv.
        bin/post -c books example/exampledocs/books.csv
      3. run followed query.
        • query1: http://localhost:8983/solr/books/select?q=+(name_str:Foundation+OR+cat:book+OR+name_str:Jhereg+OR+cat:cd)&debug=query
        • query2: http://localhost:8983/solr/books/select?q=+(name_str:Foundation+OR+name_str:Jhereg+OR+cat:book+OR+cat:cd)&debug=query
        • then you can find the parsedqueries are different.
          • query1.  ("name_str:Foundation" is lost.)
             "debug":{
                 "rawquerystring":"+(name_str:Foundation OR cat:book OR name_str:Jhereg OR cat:cd)",
                 "querystring":"+(name_str:Foundation OR cat:book OR name_str:Jhereg OR cat:cd)",
                 "parsedquery":"+(cat:book cat:cd (name_str:[[4a 68 65 72 65 67] TO [4a 68 65 72 65 67]]))",
                 "parsedquery_toString":"+(cat:book cat:cd name_str:[[4a 68 65 72 65 67] TO [4a 68 65 72 65 67]])",
                 "QParser":"LuceneQParser"}}
          • query2.  ("name_str:Foundation" isn't lost.)
               "debug":{
                 "rawquerystring":"+(name_str:Foundation OR name_str:Jhereg OR cat:book OR cat:cd)",
                 "querystring":"+(name_str:Foundation OR name_str:Jhereg OR cat:book OR cat:cd)",
                 "parsedquery":"+(cat:book cat:cd ((name_str:[[46 6f 75 6e 64 61 74 69 6f 6e] TO [46 6f 75 6e 64 61 74 69 6f 6e]]) (name_str:[[4a 68 65 72 65 67] TO [4a 68 65 72 65 67]])))",
                 "parsedquery_toString":"+(cat:book cat:cd (name_str:[[46 6f 75 6e 64 61 74 69 6f 6e] TO [46 6f 75 6e 64 61 74 69 6f 6e]] name_str:[[4a 68 65 72 65 67] TO [4a 68 65 72 65 67]]))",
                 "QParser":"LuceneQParser"}

        Attachments

        1. SOLR-14300.patch
          0.9 kB
          Hongtai Xue

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hxue Hongtai Xue
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: