First, it seems you confuse "being available for search" with "near real
time". These are two different things:
-
search after indexing is expected to take a long time because of the
unpredictable overhead in worst case scenarios (e.g. creating index,
creating mapping, creating document, creating segments, creating replica on
other nodes, segment merge etc.)
-
near real time: getting a doc ID after indexing is very fast because the
document is immediately available in a special Lucene segment kept in RAM
(in the millisecond range)
You can experiment and reduce refresh interval to 50ms and exercise
Elasticsearch (term) query operation. On RAM-only clusters, you will get
best results, but that has nothing to do with the (near) real time feature
of Elasticsearch get operation.
Also note the complexity of distributed systems. As long as there is no
information about the workload distribution and no priority index queues
are used, no upper time bound (deadlines) can be set in distributed
indexing.
If you want to find out about a faster real time switch between index write
and read, you may have interest in using
http://lucene.apache.org/core/4_10_3/core/org/apache/lucene/search/ControlledRealTimeReopenThread.html
but you have to use your own custom code, because Elasticsearch does not
make use of ControlledRealTimeReopenThread.
Jörg
On Fri, Jan 2, 2015 at 9:17 AM, vishrut.goyal@gmail.com wrote:
Hello,
Although real time searches are not possible in Elasticsearch, but "near
real time" are possible by setting "refresh_interval" to "1s" (1 second).
The problem is that even after setting refresh interval to 1 second, it's
not "guaranteed" that an indexed document will be available for search
after 1 second. My load tests indicate that sometimes even after 3 seconds
of indexing a document, it is not available for search. As per the
elasticsearch documentation, "refresh_interval" controls "how often the
refresh operation will be executed". It does not provide an upper bound on
the delay between indexing a document and that document being available for
search.
Is there any other setting in Elasticsearch that can guarantee such bound?
Thanks,
Vishrut
--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/347d1f45-c243-4c87-b4ae-e02eee039b13%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/347d1f45-c243-4c87-b4ae-e02eee039b13%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGj98SJgMt9NHVVKNKp0_2NdOt_QSsTHLvdN6ZcrkZ%2BaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.