Incorrect CollectionStatistics if IndexWriter.close is not called

2021-02-28 Thread Marc F
Hi, I don't understand if I'm doing something wrong or if it is the expected behaviour. My problem is when a document is updated the collectionStatistics returns counts as if a new document is added in the index, even after a call to IndexWriter.commit and to SearcherManager.maybeRefreshBlocking.

Re:Incorrect CollectionStatistics if IndexWriter.close is not called

2021-02-28 Thread Diego Ceccarelli (BLOOMBERG/ LONDON)
I *guess* it's due to the fact that the update is implemented as remove and reinsert the document. Deletes in Lucene are lazy: the deleted document is just flagged as deleted in a bitmap and then removed from the index only when segments are merged. Did you check IndexSearcher.collectionStatist