Can we pass index as a range

Hi ,

Here is the scenario.

I have following indexes

event-2017-12-31
event-2018-01-01
event-2018-01-02
....
....
event-2018-01-31

I want to search the data between index range event-2017-12-31 - event-2018-01-10

Current I am using it like:

res = es.search(index='event*', doc_type='farm-event',)

In that case it looks all the indexes starting from event due to this it's little slow.

Is there any way I can use "range" as index value instead of using event*

There is no need to implement this in Python. You can just use Rally's search operation as is in your track. Also, Rally does nothing special here and you can just use the multiple indices syntax of Elasticsearch, e.g.

index="event-2017-12-31,event-2018-01-0*,event-2017-01-10"

Using an index range is not possible but if you have some kind of timestamp in your data you can use a range query indeed as Elasticsearch rewrites your query anyway since 5.0 to only hit matching shards (see the blog post Instant Aggregations).

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