Esrally when gave "index": "_all", it executes search queries on all the indices instead of search only the defined indices

I have a requirement to do a simultaneous multiple search query execution in 3 indices . So I defiend them in below track.json and added "index": "_all",

as per the answer of Can't configure multiple indices on which to run a benchmarkin RALLY

Problem is that now all the indices get searched , not just the 3 indices which I already defined. Kindly help. Here is my track.json

{
"version": 2,
"description": "Tutorial benchmark for Rally Search",
"indices": [
{
"name": "geocustom",
"types": [
"docs"
]
},
{
"name": "customrecords",
"types": [
"docs"
]
},
{
"name": "banks",
"types": [
"docs"
]
}
],
"schedule": [
{
"parallel": {
"clients": 4,
"warmup-iterations": 1000,
"iterations": 4000,
"tasks": [
{
"operation": {
"name": "01-term-search",
"index": "_all",
"operation-type": "search",
"body": {
"query": {
"term": {
"key_architecture": "RODSozpcCCyoYXIUPIsAVfnoubWyYNcMFpWtbQkXxUxEeiNGKa"
}
}
}
}
},
{
"operation": {
"index": "_all",
"name": "02-match-all-query",
"operation-type": "search",
"body": {
"query": {
"match_all": {}
}
}
}
},
{
"operation": {
"name": "03-past-sixtymins-query",
"index": "_all",
"operation-type": "search",
"body": {
"query": {
"bool": {
"filter": {
"range": {
"@timestamp": {
"gte": "now-90d",
"lte": "now"
}
}
}
}
}
}
}
},
{
"operation": {
"name": "04-must-query-with-time-filter",
"index": "_all",
"operation-type": "search",
"body": {
"query": {
"bool": {
"must": [
{
"match": {
"description.keyword": "desccrption 1034"
}
}
],
"filter": [
{
"range": {
"@timestamp": {
"gte": "now-90d",
"lte": "now"
}
}
}
]
}
}
}
}
},
{
"operation": {
"name": "05-String-query AND",
"index": "_all",
"operation-type": "search",
"body": {
"query": {
"query_string": {
"default_field": "key1",
"query": "sNYhzYdjkwjeVVunliSVMwxpaJAoDbpf",
"default_operator": "AND"
}
}
}
}
},
{
"operation": {
"name": "06-String-query-OR",
"index": "_all",
"operation-type": "search",
"body": {
"query": {
"query_string": {
"default_field": "key1",
"query": "700 701",
"default_operator": "OR"
}
}
}
}
}
]
}
}
]
}

So, why do you specify _all and not a list of the indices you actually want to search?

When I gave without it , below error throwed.

Running 01-term-search,02-match-all-query,03-past-sixtymins-query,04-mu... [ 0% done]

[ERROR] Cannot race. Error in load generator (("'index' is mandatory and is miss ing for operation '01-term-search'", None)

Please check the docs for the search operation type. You'll find out that you can pass an index pattern. In the last link you'll find details about using the multi-target index syntax.

1 Like

Thank you , you are a life saver. it worked . I created indexes as pref-index-01,pref-index-02 and 03. Just passed this "name": "pref-index-*" so it picks all the ones that I mentioned early.

{
"version": 2,
"description": "Tutorial benchmark for Rally Search",
"indices": [
{
"name": "pref-index-*",
"types": [
"docs"
]
}
],
"schedule": [
{
"parallel": {
"clients": 4,
"warmup-iterations": 1000,
"iterations": 40000,
"tasks": [
{
"operation": {
"name": "01-term-search",
"operation-type": "search",
"body": {
"query": {
"term": {
"key_architecture": "RODSozpcCCyoYXIUPIsAVfnoubWyYNcMFpWtbQkXxUxEeiNGKa"
}
}
}
}
},
{
"operation": {
"name": "02-match-all-query",
"operation-type": "search",
"body": {
"query": {
"match_all": {}
}
}
}
},
{
"operation": {
"name": "03-size-limit--match-all-query",
"operation-type": "search",
"size": 100,
"body": {
"query": {
"match_all": {}
}
}
}
},
{
"operation": {
"name": "04-past-sixtymins-query",
"operation-type": "search",
"body": {
"query": {
"bool": {
"filter": {
"range": {
"@timestamp": {
"gte": "now-90d",
"lte": "now"
}
}
}
}
}
}
}
},
{
"operation": {
"name": "05-must-query-with-time-filter",
"operation-type": "search",
"body": {
"query": {
"bool": {
"must": [
{
"match": {
"description.keyword": "desccrption 1034"
}
}
],
"filter": [
{
"range": {
"@timestamp": {
"gte": "now-90d",
"lte": "now"
}
}
}
]
}
}
}
}
},
{
"operation": {
"name": "06-String-query AND",
"operation-type": "search",
"body": {
"query": {
"query_string": {
"default_field": "key1",
"query": "sNYhzYdjkwjeVVunliSVMwxpaJAoDbpf",
"default_operator": "AND"
}
}
}
}
},
{
"operation": {
"name": "07-String-query-OR",
"operation-type": "search",
"body": {
"query": {
"query_string": {
"default_field": "key1",
"query": "700 701",
"default_operator": "OR"
}
}
}
}
}
]
}
}
]
}

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