You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Johannes Goll <jo...@gmail.com> on 2010/11/16 17:56:50 UTC
Jason format exception for stats component facet results | stddev
value of NaN
Hi,
I am getting a mal-formatted json response when using the
stats component with a facet that returns a stddev value of NaN ,e.g
"facet-1":{
"min":0.0604898,
"max":0.0604898,
"sum":1.209796,
"count":20,
"missing":0,
"sumOfSquares":0.0731803180808,
"mean":0.0604898,
"stddev":NaN
},
I have submitted my complete response to
http://jsonformatter.curiousconcept.com
and got the following exception:
Warning:Invalid quotes on string for the line with "stddev":NaN
The Solr response broke my PHP code; replacing "NaN" with 0.0 solved the
issue.
Any thoughts on this?
Thanks a lot.
Johannes
Re: Jason format exception for stats component facet results | stddev
value of NaN
Posted by Chris Hostetter <ho...@fucit.org>.
: I am getting a mal-formatted json response when using the
: stats component with a facet that returns a stddev value of NaN ,e.g
I'm not a JSON expert, but i suspect NaN just isn't legal JSON, and the
JSON response writer has a bug.
quick google search...
http://stackoverflow.com/questions/1423081/json-left-out-infinity-and-nan-json-status-in-ecmascript
...suggests that the only valid value is "null"
please file a bug.
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org