Do not use expungedeletes even if you find a way to call it in the scenario you're talking about. First of all I think you'll run into the issue here: https://issues.apache.org/jira/browse/LUCENE-7976
Second it is a very heavy weight operation. It potentially rewrites _all_ of your index and it sounds like all you're really concerned about is deleting the old document when re-adding it. As Emir says, the old document is marked as deleted for you. When the segments containing the deleted document is eventually merged with another segment as part of normal indexing the resources associated with it will be purged. This is automatic too. Best, Erick On Wed, Oct 4, 2017 at 5:53 AM, Bernd Fehling <bernd.fehl...@uni-bielefeld.de> wrote: > Hi Emir, > > can you point out which commit you are using for expungeDeletes true/false? > My commit has only > commit(String collection, boolean waitFlush, boolean waitSearcher, boolean > softCommit) > > Or is expungeDeletes true/false a special combination of the boolean > parameters? > > Regards, Bernd > > > Am 04.10.2017 um 13:27 schrieb Emir Arnautović: >> Hi Bernd, >> When it comes to updating, it does not exist because indexed documents are >> not updatable - you can add new document with the same id and old one will >> be flagged as deleted. No need to delete explicitly. >> >> When it comes to expungeDeletes - that is a flag that can be set when >> committing. >> >> HTH, >> Emir >> -- >> Monitoring - Log Management - Alerting - Anomaly Detection >> Solr & Elasticsearch Consulting Support Training - http://sematext.com/ >> >> >> >>> On 4 Oct 2017, at 10:38, Bernd Fehling <bernd.fehl...@uni-bielefeld.de> >>> wrote: >>> >>> A simple question about solrj (Solr 6.4.2), >>> >>> how to update documents with expungeDeletes true/false? >>> >>> In org.apache.solr.client.solrj.SolrClient there are many add, >>> commit, delete, optimize, ... but no "update". >>> >>> What is the best way to "update"? >>> - just "add" the same docid with new content as update? >>> - first "deleteById" and then "add"? >>> - anything else...? >>> >>> And how accomplish "expungeDeletes" true/false ? >>> >>> Thanks, Bernd