How to modify the setting parameters of the index

i want to modify all index settings config in index_settings.

rally version: 1.3.0
cmd:
esrally race --track=geonames --track-params=index_settings:
["index.number_of_shards:1","index.number_of_replicas:1"]
or
esrally race --track=geonames --track-params=index_settings:{"index":{"number_of_shards":1,"number_of_replicas":1}}

but return as :

index_settings:[index.number_of_shards:1,index.number_of_replicas:1]
Traceback (most recent call last):
File "/root/miniconda3/bin/esrally", line 8, in
sys.exit(main())
File "/root/miniconda3/lib/python3.7/site-packages/esrally/rally.py", line 633, in main
cfg.add(config.Scope.applicationOverride, "track", "params", opts.to_dict(args.track_params))
File "/root/miniconda3/lib/python3.7/site-packages/esrally/utils/opts.py", line 84, in to_dict
return default_parser(csv_to_list(arg))
File "/root/miniconda3/lib/python3.7/site-packages/esrally/utils/opts.py", line 71, in kv_to_map
k, v = kv.split(":")
ValueError: too many values to unpack (expected 2)

as follows :

from rally-tracks/geonames/challenges/default.json

        {
          "operation": {
            "operation-type": "create-index",
            "settings": {{index_settings | default({}) | tojson}}
          }
        }

and README.MD
index_settings: A list of index settings. Index settings defined elsewhere (e.g. number_of_replicas) need to be overridden explicitly.

but i cannot find the way to modify the index_settings???

Hi K3v8ns,

To make this argument work with track-params as an inline CLI argument, you would need:

--track-params={"index_settings":{"index":{"number_of_shards":1,"number_of_replicas":1}}}

That is, to use parameters with dictionary values, the entire track-params argument must be a dictionary, not just the specific dictionary value.

Passing a dictionary via command-line arguments can be quite awkward with shell escaping and globbing often getting in the way. So, rather than working around this it may be easier easier to try:
--track-params=params.json
and in params.json:

{
  "index_settings":{
    "index":{
      "number_of_shards":1,
      "number_of_replicas":1
    }
  }
}

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