Solr, update unit of an existing document

When a document is sent to solr, and such a document already exists in the index (by its identifier), the new one replaces the old one.

But I do not want to automatically replace documents. Just ignore it and move on to the next one. How to configure solr.

Of course, I can request solr to check if it already has a document, but this is bad for me, because I am doing massive updates, and this will complicate the process and increase the number of requests.

So, are there any ways to configure solr to ignore duplicates?

+4
source share
1 answer

You can turn off automatic document rewriting with the same unique index defining the overwrite="false" attribute in the add item when sending documents to UpdateHandler . Take a look here .

 <add overwrite="false"> <doc> <field name="id">id</field> </doc> </add> 

In any case, this allows duplicating documents in solr , rather than skipping new documents with the same identifier as existing ones. I do not think this is your desired behavior.

I think you should write your UpdateHandler or UpdateRequestProcessor or follow the recommendations you got from the solr user mailing list .

+7
source

Source: https://habr.com/ru/post/1386174/


All Articles