Yelp/nrtsearch

Use IndexWriter.updateDocuments() in AddDocumentHandler

karthikalle opened this issue · 0 comments

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:

  1. Could lead to inconsistencies where refreshes can happen between these requests.
  2. 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.

  1. Change addDocuments in AddDocumentsHandler to use updateDocuments()
  2. Add a notion of doc_id to FieldDefs which will be used with the TermNode for deletion.