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

Munendra S N commented on SOLR-12127:
-------------------------------------

[~oliverkuldmae]
I think, this the expected behavior. 
As per the description, the field which needs to be updated is *indexed=false*, 
*stored=false* and *docvalues=true*. 
Also, Looking at the field name and value, this field is a numeric field. 
(Also, assuming it is single-valued)

On every atomic update request, Solr tries to intelligently decide if the 
update in in-place update or not.
The update you have shared qualifies for in-place update. As per Solr's 
documentation, in-place update supports set operation, Where you can set or 
replace value.
setting value to null is essentially is removing the field which is not allowed 
in in-place updates.

To treat this as atomic update replace set null with remove operation
{quote}Also, this behavior is not limited to dynamic fields, but also for 
normal fields{quote}


> Using atomic updates to remove docValues type dynamic field does not work
> -------------------------------------------------------------------------
>
>                 Key: SOLR-12127
>                 URL: https://issues.apache.org/jira/browse/SOLR-12127
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: update
>    Affects Versions: 6.6.2, 7.2
>            Reporter: Oliver Kuldmäe
>            Priority: Critical
>
> I have defined a dynamic field which is stored=false, indexed=false and 
> docValues=true. Attempting to set this field's value to null via atomic 
> update does not remove the field from the document. However, the document's 
> version is updated. Using atomic updates to set a value for the field does 
> work. Tested on 6.6.2 and 7.2.1. 
> An example of a non-working update query:
> {code:java}
> <update>
>     <add>
>         <doc>
>             <field name="id">372335</field>
>             <field name="removed_field_262884_i_dv" update="set" null="true"/>
>         </doc>
>     </add>
> </update>
> {code}
>  
> An example of a working update query:
> {code:java}
> <update>
>     <add>
>         <doc>
>             <field name="id">372335</field>
>             <field name="removed_field_262884_i_dv" 
> update="set">1521472499</field>
>         </doc>
>     </add>
> </update>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to