A quick guess: The first one works because the first document for that type is indexed and therefore the type is created when the operation returns.
But the second one doesn't work because there is a refresh interval between the completion of a bulk load operation and the actual document being added. And since it's the first document in the type, the type won't exist until that first document is indexed. Which is likely exactly what you want: Bulk operations need to defer until they are processed to allow for optimizations. I don't know Lucene internals, but a B+Tree loads vastly quicker when keys are presorted in bulk instead of added and committed one by one. The experts can chime in later, and if I'm wrong or off base anywhere I welcome the correction! 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/6f3374ff-b623-47ca-9e93-3eb2630b6ef3%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
