Date-range based sharding


I want to implement custom, time stamp based sharding in my elastic search index,

for e.g: records with time > t1 and < t2 should go in one shard and records with time >t2 and < t3 should go in the second shard.

How can I achieve this?

What's the value in you doing this?

To get better response time range queries

I don't think that will really do what you want to be honest.

If you want to filter things by that, why not add a step during ingest to add a flag that shows which timeframe it fits between (eg "time_range": "t1-t2" and "time_range": "t2-t3"), that you can then do a simple and efficient filter on.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.