Try adding: _version_:1, as per Optimistic Concurrency feature:
https://cwiki.apache.org/confluence/display/solr/Updating+Parts+of+Documents#UpdatingPartsofDocuments-OptimisticConcurrency

This should work for a single document update. If you are trying to
update multiple document, this is slightly more complicated as there
will be rejections/exceptions generated. Perhaps, it can be combined
with TollerantUpdate URP:
http://www.solr-start.com/javadoc/solr-lucene/org/apache/solr/update/processor/TolerantUpdateProcessorFactory.html

Regards,
   Alex.
P.s. SOLR-9530 may also be interesting, though its primary use case is
somewhat different
----
http://www.solr-start.com/ - Resources for Solr users, new and experienced


On 7 March 2017 at 07:30, ~$alpha` <lavesh.ra...@gmail.com> wrote:
> *SOLR_URL/update -d \'
> [
>  {"id" : "1",
>   "ONLINE" : {"set":"1"}
>  }
> ]'*
>
> I am using solr6.3. Above command works fine as it updates online flag to 1
> for id=1. But the issue is if the record is not present then it adds a value
> as id=1 and online=1 which is not desired.
>
> So question is, is it possible that so updates the value only if the record
> is present in the solr.
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Solr-Update-If-Record-Exists-tp4323767.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to