This isn't a Solr-specific answer, but the easiest approach might be to just collect the document IDs you're about to add, query for them, and then filter out the ones Solr already has (this'll give you a nice list for later reporting). You'll need to keep your batch sizes below maxBooleanClauses in solrconfig.xml.
Overall, this might be simpler to maintain and less prone to bugs. k/r, Scott On Wed, Feb 11, 2015 at 4:59 AM, Sankalp Gupta <sankalp.gu...@snapdeal.com> wrote: > Hi All, > My server side we are trying to add multiple documents in a list and then > ask solr to add them in solr (using solrj client) and then after its > finished calling the commit. > Now we also want to control concurrency and for that we wanted to use > solr's optimistic lock/versioning feature. That is good but *in case of > bulk docs add, the solr doesn't perform add docs as expected.* It fails as > soon as it finds any doc with optimistic lock failure and return response > telling only the first failed doc (adding all docs before that and no docs > are added after that). *We require solr to add all docs for which no > versioning problem is there and return list of all failed docs. * > Please can anyone suggest a way to do this? > > Regards > Sankalp Gupta > -- Scott Stults | Founder & Solutions Architect | OpenSource Connections, LLC | 434.409.2780 http://www.opensourceconnections.com