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

can't query against negative float or double values when indexed="false" docValues="true" multiValued="false"

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 5.5.1, 5.6, 6.0, 6.1, 7.0
    • None
    • None

    Description

      Haven't dug into this yet, but something is evidently wrong in how the DocValues based queries get build for single valued float or double fields when negative numbers are involved.

      Steps to reproduce...

      $ bin/solr -e schemaless -noprompt
      ...
      $ curl -X POST -H 'Content-type:application/json' --data-binary '{ "add-field":{ "name":"f_dv_multi", "type":"tfloat", "stored":"true", "indexed":"false", "docValues":"true", "multiValued":"true" }, "add-field":{ "name":"f_dv_single", "type":"tfloat", "stored":"true", "indexed":"false", "docValues":"true", "multiValued":"false" } }' http://localhost:8983/solr/gettingstarted/schema
      {
        "responseHeader":{
          "status":0,
          "QTime":84}}
      $ curl -X POST -H 'Content-type:application/json' --data-binary '[{"id":"test", "f_dv_multi":-4.3, "f_dv_single":-4.3}]' 'http://localhost:8983/solr/gettingstarted/update/json/docs?commit=true'
      {"responseHeader":{"status":0,"QTime":57}}
      $ curl 'http://localhost:8983/solr/gettingstarted/query?q=f_dv_multi:"-4.3"'
      {
        "responseHeader":{
          "status":0,
          "QTime":5,
          "params":{
            "q":"f_dv_multi:\"-4.3\""}},
        "response":{"numFound":1,"start":0,"docs":[
            {
              "id":"test",
              "f_dv_multi":[-4.3],
              "f_dv_single":-4.3,
              "_version_":1512962117004689408}]
        }}
      $ curl 'http://localhost:8983/solr/gettingstarted/query?q=f_dv_single:"-4.3"'
      {
        "responseHeader":{
          "status":0,
          "QTime":5,
          "params":{
            "q":"f_dv_single:\"-4.3\""}},
        "response":{"numFound":0,"start":0,"docs":[]
        }}
      

      Explicit range queries (which is how numeric "field" queries are implemented under the cover) are equally problematic...

      $ curl 'http://localhost:8983/solr/gettingstarted/query?q=f_dv_multi:%5B-4.3+TO+-4.3%5D'
      {
        "responseHeader":{
          "status":0,
          "QTime":0,
          "params":{
            "q":"f_dv_multi:[-4.3 TO -4.3]"}},
        "response":{"numFound":1,"start":0,"docs":[
            {
              "id":"test",
              "f_dv_multi":[-4.3],
              "f_dv_single":-4.3,
              "_version_":1512962117004689408}]
        }}
      $ curl 'http://localhost:8983/solr/gettingstarted/query?q=f_dv_single:%5B-4.3+TO+-4.3%5D'
      {
        "responseHeader":{
          "status":0,
          "QTime":0,
          "params":{
            "q":"f_dv_single:[-4.3 TO -4.3]"}},
        "response":{"numFound":0,"start":0,"docs":[]
        }}
      

      Attachments

        1. SOLR-8082.patch
          34 kB
          Steven Rowe
        2. SOLR-8082.patch
          34 kB
          Yonik Seeley
        3. SOLR-8082.patch
          33 kB
          Ishan Chattopadhyaya
        4. SOLR-8082.patch
          20 kB
          Ishan Chattopadhyaya
        5. SOLR-8082.patch
          19 kB
          Ishan Chattopadhyaya
        6. SOLR-8082.patch
          19 kB
          Ishan Chattopadhyaya
        7. SOLR-8082.patch
          16 kB
          Ishan Chattopadhyaya
        8. SOLR-8082.patch
          10 kB
          Chris M. Hostetter

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sarowe Steven Rowe
            hossman Chris M. Hostetter
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment