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

Rahul Goswami commented on SOLR-16360:
--------------------------------------

RCA: during a regular (non-atomic) update, the toInternal() method gets called 
to interpret the value and hence the documented behavior is observed. However 
during atomic update, the toNativeType() method gets called which doesn't check 
for the first character of value, thereby breaking the behavior.

> Atomic update on boolean fields doesn't reflect when value starts with "1", 
> "t" or "T"
> --------------------------------------------------------------------------------------
>
>                 Key: SOLR-16360
>                 URL: https://issues.apache.org/jira/browse/SOLR-16360
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 8.11
>            Reporter: Rahul Goswami
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> I am running Solr 8.11. As per the Solr documentation, any value starting 
> with "1","t" or "T" for a boolean field is interpreted as true.
>  
> [https://solr.apache.org/guide/8_11/field-types-included-with-solr.html#recommended-field-types]
>  
> However, I hit a potential Solr bug where if the String value  "1","t" or "T" 
>  is passed in an atomic update, it is treated as false.
>  
> //Eg:Below document is indexed first => query returns "inStock" as true (as 
> expected) 
> {
> "id":"test",
> "inStock":"true"
> }
>  
> //Follow above update with below atomic update and commit. => inStock becomes 
> false in query result
> {
> "id":"test",
> "inStock":\{"set":"1"}
> }
>  
> This doesn't happen though if value "1" is passed in a regular update.
> Eg:Below update reflects the value of inStock as true when queried.
> {
> "id":"test",
> "inStock":"1"
> }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to