About the Wiriting Operation In ES

(WeiqiangYuan) #1

Hi, I have two questions about the Writing Operation in ES.

Q1: I wonder whether I have understood the following descriptions correctly:
When a writing operation returns successfully on a document, the changes will not be been until the refresh_interval has passed. This is due the reason that when a writing operation to a document succeeds, the recent document will only be in the 'in-memory buffer'. And the document the 'in-memory buffer can't be searchable. After the 'refresh_interval'(default 1 second) , this document in buffer are flushed to segments and the documents will then be searchable.

Q2: If I want to make document be searchable immediately right after the writing operation returns successfully, is there any way for ES to make it true? Just like using ES as a NoSql Document Databases.

I want to know something about the time when a writing operation will be

(David Pilato) #2

You can refresh the index to make your document searchable but don't do that on every request.

Note that all CRUD operations are real time.

Search is not.

(WeiqiangYuan) #5

Thank you.

I wonder what's the time of the Writing Operation returns successfully, is it just after the time that document has been written to an in-memory indexing buffer?

Can we alter the time of the Writing Operation returns successfully to the time that the document has been committed to segment?

(Nik Everett) #6

The write returns successfully when the translog has been synced to disk
(default behavior in 2.x). There is a feature request called "block until
refresh" that asks to add an option to index requests so that they will not
return until after the document has been refreshed. It is pretty well
stalled but I plan to pick it up sometime in the future. It might be a
while though.

(system) #7