You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2015/09/23 01:49:04 UTC

[jira] [Updated] (SOLR-8082) can't query against negative float or double values when indexed="false" docValues="true" multiValued="false"

     [ https://issues.apache.org/jira/browse/SOLR-8082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-8082:
---------------------------
    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...

{noformat}
$ 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":[]
  }}
{noformat}

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

{noformat}
$ 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":[]
  }}
{noformat}

  was:
Haven't dug into this yet, but something is evidently wrong in how the DocValues based queries get build for single valued flaot fields (may affect other trie based fields?

Steps to reproduce...

{noformat}
$ 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":[]
  }}
{noformat}

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

{noformat}
$ 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":[]
  }}
{noformat}

        Summary: can't query against negative float or double values when indexed="false" docValues="true" multiValued="false"  (was: float query bug when indexed="false" docValues="true" multiValued="false")

updated summary & description to capture new info (affects doubles, only seems to affect negative values)

> can't query against negative float or double values when indexed="false" docValues="true" multiValued="false"
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8082
>                 URL: https://issues.apache.org/jira/browse/SOLR-8082
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Hoss Man
>         Attachments: SOLR-8082.patch
>
>
> 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...
> {noformat}
> $ 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":[]
>   }}
> {noformat}
> Explicit range queries (which is how numeric "field" queries are implemented under the cover) are equally problematic...
> {noformat}
> $ 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":[]
>   }}
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org