[
https://issues.apache.org/jira/browse/SOLR-9490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15477310#comment-15477310
]
Colvin Cowie edited comment on SOLR-9490 at 9/9/16 3:24 PM:
------------------------------------------------------------
Unfortunately I don't think that I personally can provide a unit test (without
getting approval to do so).
However I can reproduce the error reliably just by deploying the cloud example
and creating a document:
{noformat}
solr stop -all
rm -rf ../example/cloud
solr -e cloud -noprompt
curl http://localhost:8983/solr/gettingstarted/update -d "[ {\"f_b\": true,
\"id\": \"1\" }, {\"f_b\": false, \"id\": \"2\" }]"
{noformat}
http://localhost:8983/solr/gettingstarted/select?facet.field=f_b&facet=on&indent=on&q=*:*&wt=json
{noformat}
{
"responseHeader":{
"zkConnected":true,
"status":0,
"QTime":78,
"params":{
"q":"*:*",
"facet.field":"f_b",
"indent":"on",
"facet":"on",
"wt":"json"}},
"response":{"numFound":2,"start":0,"maxScore":1.0,"docs":[
{
"f_b":false,
"id":"1",
"_version_":1545007494796935168},
{
"f_b":false,
"id":"2",
"_version_":1545007494796935168}]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"f_b":[
"false",1,
"true",1]},
"facet_ranges":{},
"facet_intervals":{},
"facet_heatmaps":{}}}
{noformat}
The strange thing however, is that when I try and reproduce the problem with
our actual configuration and test data which wrongly returns false on the
javabin response, the json response returns the correct response. It appears in
that case that {{toExternal()}} isn't being called at all. I don't know enough
about the code to know why/how it would be bypassing {{toExternal()}} in that
case though.
was (Author: cjcowie):
Unfortunately I don't think that I personally can provide a unit test (without
getting approval to do so).
However I can reproduce the error reliably just by deploying the cloud example
and creating a document:
{noformat}
solr stop -all
rm -rf ../example/cloud
solr -e cloud -noprompt
curl http://localhost:8983/solr/gettingstarted/update -d "[ {\"f_b\": true,
\"id\": \"1\" }, {\"f_b\": false, \"id\": \"2\" }]"
{noformat}
http://localhost:8983/solr/gettingstarted/select?facet.field=f_b&facet=on&indent=on&q=*:*&wt=json
{noformat}
{
"responseHeader":{
"zkConnected":true,
"status":0,
"QTime":78,
"params":{
"q":"*:*",
"facet.field":"f_b",
"indent":"on",
"facet":"on",
"wt":"json"}},
"response":{"numFound":2,"start":0,"maxScore":1.0,"docs":[
{
"f_b":false,
"id":"1",
"_version_":1545007494796935168},
{
"f_b":false,
"id":"2",
"_version_":1545007494796935168}]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"f_b":[
"false",1,
"true",1]},
"facet_ranges":{},
"facet_intervals":{},
"facet_heatmaps":{}}}
{noformat}
The strange thing however, is that when I try and reproduce the problem with
our actual configuration and test data which wrongly returns false on the
javabin response, I struggle to get the json response to produce the wrong
result as above. It appears in that case that {{toExternal()}} isn't being
called at all. I don't know enough about the code to know why/how it would be
bypassing {{toExternal()}} in that case though.
> BoolField always returning false for non-DV fields?
> ---------------------------------------------------
>
> Key: SOLR-9490
> URL: https://issues.apache.org/jira/browse/SOLR-9490
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Affects Versions: 6.2
> Reporter: Hoss Man
> Priority: Critical
>
> 2 diff users posted comments in SOLR-9187 indicating that changes introduced
> in that issue have broken BoolFields that do *not* use DocValues...
> [~cjcowie]...
> {quote}
> Hi, I've just picked up 6.2.0. It seems that the change to toExternal() in
> BoolField now means that booleans without DocValues return null, which then
> turns into Boolean.FALSE in toObject() regardless of whether the value is
> true or false.
> e.g. with this schema, facet counts are correct, the returned values are
> wrong.
> {code}
> <field name="f_EVE64" type="boolean" indexed="true" stored="true"
> required="false" multiValued="false"/>
> <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
> {code}
> {code}
> "response":{"numFound":2,"start":0,"maxScore":1.0,"docs":[
> {
> "id":"124",
> "f_EVE64":false,
> "_version_":1544828487600177152},
> {
> "id":"123",
> "f_EVE64":false,
> "_version_":1544828492458229760}]
> },
> "facet_counts":{
> "facet_queries":{},
> "facet_fields":{
> "f_EVE64":[
> "false",1,
> "true",1]},
> {code}
> Could toExternal() perhaps fallback to how it originally behaved? e.g.
> {code}
> if (f.binaryValue() == null) {
> return indexedToReadable(f.stringValue());
> }
> {code}
> {quote}
> [~pavan_shetty]...
> {quote}
> I downloaded solr version 6.2.0 (6.2.0
> 764d0f19151dbff6f5fcd9fc4b2682cf934590c5 - mike - 2016-08-20 05:41:37) and
> installed my core.
> In my schema.xml i have an field like following :
> <field name="stock_status" type="boolean" indexed="true" stored="true"
> multiValued="false"/>
> Now i am accessing this field using SolrJ (6.1.0). But i am always getting
> false value for above field even though it contains true boolean value. This
> is happening for all boolean fields.
> http://localhost:8983/solr...wt=javabin&version=2 HTTP/1.1
> It is working fine in other response writer.
> If i change the solr version to 6.1.0, with same SolrJ, it starts working. So
> clearly this is a bug in version 6.2.0.
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]