Use IndexWriter.updateDocuments() in AddDocumentHandler
karthikalle opened this issue · 0 comments
karthikalle commented
Currently we don't provide an API to update documents in NRTSearch, but instead have the addDocuments request. It is up to the clients to send delete and add documents externally, and has the following problems:
- Could lead to inconsistencies where refreshes can happen between these requests.
- If there are two add documents requests, these would end up as two separate documents than being updated.
It would be good to have the updates happen atomically in a single request. We could use the updateDocuments() from lucene for this.
- Change addDocuments in AddDocumentsHandler to use updateDocuments()
- Add a notion of
doc_id
to FieldDefs which will be used with the TermNode for deletion.