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

Noble Paul commented on SOLR-11267:
-----------------------------------

Inside doAddDistinct
{code}
if (existingField == null) {
 doAdd(toDoc, sif, fieldVal);
 return;
}
{code}
This doesn't defend against user passing in a non-distinct set of values to an 
empty field
example
{code}
{"id":"mydoc",
 "sub_categories":{"add-distinct":["games","games"]}
}
{code}




> Add support for "add-distinct" atomic update operation
> ------------------------------------------------------
>
>                 Key: SOLR-11267
>                 URL: https://issues.apache.org/jira/browse/SOLR-11267
>             Project: Solr
>          Issue Type: New Feature
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Ishan Chattopadhyaya
>            Assignee: Ishan Chattopadhyaya
>            Priority: Major
>         Attachments: SOLR-11267.patch, SOLR-11267.patch
>
>
> Often, a multivalued field is used as a set of values. Since multivalued 
> fields are more like lists than sets, users do two consecutive operations, 
> remove and add, to insert an element into the field and also maintain the 
> set's property of only having unique elements.
> Proposing a new single operation, called "add-distinct" (which essentially 
> means "add-if-doesn't exist") for this.



--
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