bitemyapp/bloodhound

No way of using default shard- and replica counts for indexes

bugthunk opened this issue · 6 comments

I'm curious why there is no way of specifying that an index should be created using the default number of shards and replicas defined on the index. This means that these settings are always controlled from the client end. Is this a conscious design decision, or are there some particular difficulties associated with such functionality?

It's not particular to shard and replica counts, you shouldn't rely on Elasticsearch's defaults. They affect operational decisions too. The availability and consistency tradeoffs are something you have to think about and test against your expected workload. Similarly, I strongly recommend specifying a proper mapping type.

Elasticsearch likes to lose data, protect ya neck.

I agree with the sentiment that relying on the ElasticSearch default here would be bad. The defaults for shard and replica count are almost never appropriate.

I disagree strongly. The defaults can be controlled by an admin that does not in fact have access to updating source code. If you do not want to rely on ES defaults, you can always create client side code that in fact enforces this for you - as you're doing it now, you're taking away one fine feature from your whole user base. But do what thou wilt.

@bugthunk I think it's reasonable to want ops to be responsible for this but then why is the application setting the index shard and replica settings at all? You phrased it in terms of using the default settings the cluster deploys with, not "I don't want to override what ops did."

If the notion is that the application has to create indices on the fly but needs to use an index-template created by the ops and not override those settings, I'd say that's reasonable. Are you thinking of something like https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html ?

"Are you thinking of something like<...>?": Yes. I should have used the word templates in there somewhere. Mea culpa.

If I could tell how to not send in replica and shard counts using bloodhound, I would. Even createIndexWith needs a specified shard count.

Sorry for the late response. I'm a misfit.