Why did Solr stats min/max values were returned as float number for field of type="pint"?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Why did Solr stats min/max values were returned as float number for field of type="pint"?

Wendy2
Hi Solr users,

I have a pint field:
<field name="rcsb_entry_info.disulfide_bond_count" type="pint"
indexed="true" stored="true"/>

But Solr stats min/max values were returned as float numbers ( "min":0.0,
"max":1356.0) . I thought "pint" type fields should return min/max as int.
Is there something that user can do to make sure it returns as int type
(which matches the field definition)?   Thanks!


{
  "responseHeader":{
    "status":0,
    "QTime":17,
    "params":{
      "q":"*:*",
      "stats":"true",
      "fl":"",
      "rows":"0",
      "stats.field":"rcsb_entry_info.disulfide_bond_count"}},
  "response":{"numFound":151364,"start":0,"docs":[]
  },
  "stats":{
    "stats_fields":{
      "rcsb_entry_info.disulfide_bond_count":{
        "min":0.0,
        "max":1356.0,
        "count":151363,
        "missing":1,
        "sum":208560.0,
        "sumOfSquares":5660388.0,
        "mean":1.3778796667613618,
        "stddev":5.958002695748158}}}}



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Why did Solr stats min/max values were returned as float number for field of type="pint"?

Joel Bernstein
This syntax is bringing back correct data types:

rows=0&version=2&q=stock_s:10&stats=true&NOW=1556849474583&isShard=true&wt=javabin&stats.field={!max=true
}id_i&stats.field={!max=true }response_d

This is the query that the stats Stream Expressions writes under the
covers. The Streaming Expression looks like this:

stats(testapp, q="stock_s:10", max(id_i), max(response_d))











Joel Bernstein
http://joelsolr.blogspot.com/


On Thu, May 2, 2019 at 8:47 PM Wendy2 <[hidden email]> wrote:

> Hi Solr users,
>
> I have a pint field:
> <field name="rcsb_entry_info.disulfide_bond_count" type="pint"
> indexed="true" stored="true"/>
>
> But Solr stats min/max values were returned as float numbers ( "min":0.0,
> "max":1356.0) . I thought "pint" type fields should return min/max as int.
> Is there something that user can do to make sure it returns as int type
> (which matches the field definition)?   Thanks!
>
>
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":17,
>     "params":{
>       "q":"*:*",
>       "stats":"true",
>       "fl":"",
>       "rows":"0",
>       "stats.field":"rcsb_entry_info.disulfide_bond_count"}},
>   "response":{"numFound":151364,"start":0,"docs":[]
>   },
>   "stats":{
>     "stats_fields":{
>       "rcsb_entry_info.disulfide_bond_count":{
>         "min":0.0,
>         "max":1356.0,
>         "count":151363,
>         "missing":1,
>         "sum":208560.0,
>         "sumOfSquares":5660388.0,
>         "mean":1.3778796667613618,
>         "stddev":5.958002695748158}}}}
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Why did Solr stats min/max values were returned as float number for field of type="pint"?

Wendy2
Hi Joel,

Thanks for your response.

Regarding your response "This syntax is bringing back correct data types",

I have a pint field, the stats returned the following min/max values.
"min":0.0,
"max":1356.0,

But I was expecting min/max values like below. Is it possible?    Thanks!
"min":0
"max":1356



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html