Hi Shawn, Solr optimistic concurrency is worked fine only for 1 field But in my case two or more field can be updated at a same time But one field can not be updated if its corresponding timestamp is greater than request time
On 18-May-2017 6:15 PM, "Shawn Heisey" <apa...@elyograg.org> wrote: On 5/18/2017 2:05 AM, Aman Deep Singh wrote: > Is their any way to do the SOLR atomic update based on some condition > Suppose in my SOLR schema i have some fields > > 1. field1 > 2. field2 > 3. field1_timestamp > 4. field2_timestamp > > Now i have to update value of field1 only if field1_timestamp is less then > the provided timestamp > I found a SOLR thread for same question > http://lucene.472066.n3.nabble.com/Conditional-atomic- update-td4277224.html > but it doesn't contains any solution I have never heard of anything like this. If you want to write your own custom update processor that looks for the condition and removes the appropriate atomic update command(s) from the request, or even completely aborts the request, you can certainly do so. That seems to be what was suggested by the author of the thread that you referenced. What you have described sounds a little bit like optimistic concurrency, something Solr supports out of the box. The feature isn't identical to what you described, but maybe you can adapt it. Automatically assigned _version_ values are derived from a java timestamp. http://yonik.com/solr/optimistic-concurrency/ Thanks, Shawn