Bulk requests are processed together, so my only guess is that it returns 
when it knows enough about whether the operation on each document succeeded 
or failed. But there may still be a little more work before it finally 
makes it to the database.

Instead of the sleep, try an index refresh. Maybe that will make the test 
case more deterministic.

Also note that even in the first case, there will be a slight delay between 
the return of the successful update and the ability to query on one or more 
of the indexed fields. Indexing takes a little time (configurable; 
typically about 1s or 2s for non-bulk updates), but the index operation 
returns as soon as it knows all it needs to know about whether the document 
can be successfully updated. However, a get-by-id operation can be done 
immediately after an update; only the indexing of the fields as reflected 
in the on-disk Lucene shard is not quiite realtime and synchronous to the 
update request.

Also see: 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html#index-refresh

But in general: Whenever I index (create or update) a document, I leave the 
recommended defaults in force, and only depend on a get-by-id to succeed 
immediately after. And for bulk loading, I'm happy enough that 97 million 
documents (not too complex, but still very useful) can be bulk loaded and 
reloaded on my laptop in under 2.5 hours, and that chunks of "daily" 
updates of a1 million updates and 1 million deletes can be bulk loaded in 
10 or 15 minutes.

And I find that ElasticSearch provides a very good balance between optimal 
update performance and quick search availability of those updates.

Also, my experience with your particular test case is very limited. I've 
recently locked down ElasticSearch and all my mappings so that neither the 
index nor the type is automatically created nor are unknown fields able to 
be indexed. I must explicitly create an index and load all of the mappings 
for all of the fields in all of the types before any documents are indexed. 
But I digress...

Hope this helps!

Brian

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/29a731f6-87d9-4c97-9db6-d606f099e947%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to