What does Setrefresh do while index a document?


(Arjit Gupta) #1

Hi,

I am new to elastic search. I just want to know what does setrefresh do ?
from the docs
http://www.elasticsearch.org/guide/reference/api/index_/
It says it makes it available to search.
I am interested in knowing some internals to how does refresh happen ?
Does it refreshes the whole cache ? Or only merges the segments which
contains the document.
Does setrefersh effects "other" documents also ?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Arjit Gupta) #2

Any one ?

On Wednesday, June 5, 2013 6:04:59 PM UTC+5:30, Arjit Gupta wrote:

Hi,

I am new to elastic search. I just want to know what does setrefresh do ?
from the docs
http://www.elasticsearch.org/guide/reference/api/index_/
It says it makes it available to search.
I am interested in knowing some internals to how does refresh happen ?
Does it refreshes the whole cache ? Or only merges the segments which
contains the document.
Does setrefersh effects "other" documents also ?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Reelsen) #3

Hey

refreshing is an expensive operation, which makes data, that has been
recently indexed, available for searching.
Because it is that expensive, a refresh is executed once per second in the
background instead of every indexing operation.

Refresh does not refresh a cache. Refresh does not do a merge.
Refresh affects all documents, which have been indexed since the last
refresh.

So what does it do? In order to understand this, you need to know, that a
lucene index reader (which is used for searches at the end) is always a
snapshot of data at a certain time. In order to search in recently indexed
documents, you need move the point in time and index reader can read from,
to a newer point. And this is exactly what the refresh call is doing.

Hope this helps a bit.

--Alex

On Thu, Jun 6, 2013 at 3:20 AM, Arjit Gupta arjit292@gmail.com wrote:

Any one ?

On Wednesday, June 5, 2013 6:04:59 PM UTC+5:30, Arjit Gupta wrote:

Hi,

I am new to elastic search. I just want to know what does setrefresh do ?
from the docs
http://www.elasticsearch.org/**guide/reference/api/index_/http://www.elasticsearch.org/guide/reference/api/index_/
It says it makes it available to search.
I am interested in knowing some internals to how does refresh happen ?
Does it refreshes the whole cache ? Or only merges the segments which
contains the document.
Does setrefersh effects "other" documents also ?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Andreas Senfter) #4

Hi to all,
thanks Alexander for your explanation. But I've an additional question when using the bulk index/update call via node-client with enabled refresh option in elasticsearch version 1.5.2.
Is it guaranteed that the IndexReader is updated during the bulkRequest.execute().actionGet() method call, so that all new or updated docs are searchable directly afterwards?


(Andreas Senfter) #5

Has anyone a hint for me?


(system) #6