Skip to content

Conversation

@RikEnde
Copy link

@RikEnde RikEnde commented Jan 30, 2017

This might break existing code (I don't have any to test with), it changes how IndexRequests work.

new IndexRequest()
                            .setId("document_1")
                            .setIndex("index_name")
                            .setType("document_type")
                            .setAction(IndexRequest.Action.UPDATE)
                            .setEntity(entity);   

The actions correspond to ES syntax index, update, create and delete. Index is default.

BATCH_SIZE is the number of documents to be indexed per _bulk request. In some non-scientific tests, I've found that for my data set, performance rapidly drops off with a batch size smaller than 1000, but does not increase measurably by increasing it further, until finally it gets so large that ES throws an error.

@jettro
Copy link
Member

jettro commented Feb 14, 2017

I do not really like the idea of an IndexRequest with a type. I generally prefer to have separate classes for Index, Update, Delete, Create requests. Also thinking about the generic parts over all different requests including Bulk requests. Think about the refresh option, versioning and maybe others. I'll keep your pull request around. I do like the part for creating the bulk request. So I will try to incorporate that when I gave it some more thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants