Reputation: 582
Maybe someone got the same problem as I and can help me, when I delete document there is delay between solr index refresh and I got still on my list document which was just deleted Thans in advance
Upvotes: 0
Views: 599
Reputation: 544
It looks like you are using SolrJ UpdateRequest to delete the document. Since you are not explicitly committing the update, the actual timing of index update depends on your Solr configuration. From Solr docs (https://cwiki.apache.org/confluence/display/solr/Near+Real+Time+Searching)
"A common configuration is to do a hard autocommit every 1-10 minutes and a autosoftcommit every second"
If you need to make the delete committed to index right away, you can add "COMMIT" action to your UpdateRequest like this:
UpdateRequest req = new UpdateRequest();
req.deleteByQuery("documentId:"documentId);
req.setAction(ACTION.COMMIT, false, true);
this will have the same effect as adding "?action=commit" to your update request and will perform a soft commit right away.
Upvotes: 1