[jira] [Comment Edited] (SOLR-11267) Add support for "add-distinct" atomic update operation
[ https://issues.apache.org/jira/browse/SOLR-11267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16397686#comment-16397686 ] Noble Paul edited comment on SOLR-11267 at 3/13/18 9:33 PM: It's already in 7.3 branch was (Author: noble.paul): It can be committed to the 7.3 branch > 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: Noble Paul >Priority: Blocker > Fix For: 7.3 > > Attachments: SOLR-11267.patch, 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Comment Edited] (SOLR-11267) Add support for "add-distinct" atomic update operation
[ https://issues.apache.org/jira/browse/SOLR-11267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16372507#comment-16372507 ] Amrit Sarkar edited comment on SOLR-11267 at 2/22/18 7:14 AM: -- examples on how to use {{add-distinct}}: pass as list: {code} {"id":"mydoc", "price":{"set":99}, "popularity":{"inc":20}, "categories":{"add":["toys","games"]}, "sub_categories":{"add-distinct":["children games","PG games"]}, "promo_ids":{"remove":"a123x"}, "tags":{"remove":["free_to_try","on_sale"]} } {code} pass as singleton value: {code} {"id":"mydoc", "sub_categories":{"add-distinct":"V games"} } {code} was (Author: sarkaramr...@gmail.com): examples on how to use {{add-distinct}}: pass as list: {code} {"id":"mydoc", "price":{"set":99}, "popularity":{"inc":20}, "categories":{"add":["toys","games"]}, "sub_categories":{"add-distinct":["children games","PG games"]}, "promo_ids":{"remove":"a123x"}, "tags":{"remove":["free_to_try","on_sale"]} } pass as singleton value: {code} {code} {"id":"mydoc", "sub_categories":{"add-distinct":"V 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Comment Edited] (SOLR-11267) Add support for "add-distinct" atomic update operation
[ https://issues.apache.org/jira/browse/SOLR-11267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16185528#comment-16185528 ] Amrit Sarkar edited comment on SOLR-11267 at 10/17/17 9:42 PM: --- [~ichattopadhyaya], I cooked up a little patch to support "add-distinct". I also believe this will be a very wealthy addition in atomic requests as users have to parse the SET from the list on their application code today. Design: if field not present, do conventional "add" atomic operation or else: if passed values are list, check each value present already and then add else if singular, check value present already and then add Included small test to verify that. Looking forward to your review and feedback. was (Author: sarkaramr...@gmail.com): [~ichattopadhyaya], I cooked up a little patch to support "add-distinct". I also believe this will be a very wealthy addition in atomic requests as users have to parse the SET from the list on their application code today. Design: if field not present, do conventional "add" atomic operation or else: if passed values are list, check each value present already and then add else if singular, check each value present already and then add Included small test to verify that. Looking forward to your review and feedback. > 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 > 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 (v6.4.14#64029) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org