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 2017/12/18 18:22:00 UTC

[jira] [Commented] (SOLR-11775) json.facet can use inconsistent Long/Integer for "count" depending on shard count

    [ https://issues.apache.org/jira/browse/SOLR-11775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16295378#comment-16295378 ] 

Hoss Man commented on SOLR-11775:
---------------------------------

Trivial to reproduce...

* "Non-Distributed" request (either standalone, or cloud w/one shard)...{noformat}
bin/solr -e techproducts
# (or bin/solr -e cloud, choose 1 shard w/ sample_techproducts_configs, and index the docs manually)
...
$ curl http://localhost:8983/solr/techproducts/select -d 'q=*:*&wt=xml&rows=0&json.facet={ foo:{type:range, field:price, start:0, end:1000, gap:100, other:all } }'
<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">23</int>
  <lst name="params">
    <str name="q">*:*</str>
    <str name="json.facet">{ foo:{type:range, field:price, start:0, end:1000, gap:100, other:all } }</str>
    <str name="rows">0</str>
    <str name="wt">xml</str>
  </lst>
</lst>
<result name="response" numFound="32" start="0">
</result>
<lst name="facets">
  <int name="count">32</int>
  <lst name="foo">
    <arr name="buckets">
      <lst>
        <float name="val">0.0</float>
        <int name="count">7</int>
      </lst>
      <lst>
        <float name="val">100.0</float>
        <int name="count">2</int>
      </lst>
      <lst>
        <float name="val">200.0</float>
        <int name="count">1</int>
      </lst>
      ...
    </arr>
    <lst name="before">
      <int name="count">0</int>
    </lst>
    <lst name="after">
      <int name="count">1</int>
    </lst>
    <lst name="between">
      <int name="count">15</int>
    </lst>
  </lst>
</lst>
</response>
{noformat}
* Using muliple shards...{noformat}
bin/solr -e cloud
# choose multiple shards, any number of replicas, w/ sample_techproducts_configs
bin/post -c techproducts example/exampledocs/
$ curl http://localhost:8983/solr/techproducts/select -d 'q=*:*&wt=xml&rows=0&json.facet={ foo:{type:range, field:price, start:0, end:1000, gap:100, other:all } }'
<?xml version="1.0" encoding="UTF-8"?>
<response>

<lst name="responseHeader">
  <bool name="zkConnected">true</bool>
  <int name="status">0</int>
  <int name="QTime">60</int>
  <lst name="params">
    <str name="q">*:*</str>
    <str name="json.facet">{ foo:{type:range, field:price, start:0, end:1000, gap:100, other:all } }</str>
    <str name="rows">0</str>
    <str name="wt">xml</str>
  </lst>
</lst>
<result name="response" numFound="50" start="0" maxScore="1.0">
</result>
<lst name="facets">
  <long name="count">50</long>
  <lst name="foo">
    <arr name="buckets">
      <lst>
        <float name="val">0.0</float>
        <long name="count">17</long>
      </lst>
      <lst>
        <float name="val">100.0</float>
        <long name="count">2</long>
      </lst>
      <lst>
        <float name="val">200.0</float>
        <long name="count">1</long>
      </lst>
      ...
    </arr>
    <lst name="before">
      <long name="count">0</long>
    </lst>
    <lst name="after">
      <long name="count">1</long>
    </lst>
    <lst name="between">
      <long name="count">25</long>
    </lst>
  </lst>
</lst>
</response>
{noformat}


> json.facet can use inconsistent Long/Integer for "count" depending on shard count
> ---------------------------------------------------------------------------------
>
>                 Key: SOLR-11775
>                 URL: https://issues.apache.org/jira/browse/SOLR-11775
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>
> (NOTE: I noticed this while working on a test for {{type: range}} but it's possible other facet types may be affected as well)
> When dealing with a single core request -- either standalone or a collection with only one shard -- json.facet seems to use "Integer" objects to return the "count" of facet buckets, however if the shard count is increased then the end client gets a "Long" object for the "count"
> (This isn't noticable when using {{wt=json}} but can be very problematic when trying to write client code using {{wt=xml}} or SolrJ



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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