Open BeardyC opened 3 years ago
Thanks for the question. There's a good chance that the ES options have changed over time, this repo probably hasn't caught up with how things are done these days.
It works fine on old ES (tried 5.5 first). On the new ES (7.2), with the index not being there, so it should create a new one, the output is (added printing the HTTP Error exception, hence HTTP 400):
[I 210603 11:33:30 es_test_data:55] Trying to create index http://localhost:9200/test_data
HTTP 400: Bad Request
[I 210603 11:33:30 es_test_data:61] Looks like the index exists already
The refresh option is not available in ES 7 and the scheme require new index field.
diff --git a/es_test_data.py b/es_test_data.py
index 403d3f2..294ac20 100755
--- a/es_test_data.py
+++ b/es_test_data.py
@@ -43,10 +43,11 @@ def delete_index(idx_name):
def create_index(idx_name):
schema = {
"settings": {
- "number_of_shards": tornado.options.options.num_of_shards,
- "number_of_replicas": tornado.options.options.num_of_replicas
- },
- "refresh": True
+ "index": {
+ "number_of_shards": tornado.options.options.num_of_shards,
+ "number_of_replicas": tornado.options.options.num_of_replicas
+ }
+ }
}
body = json.dumps(schema)
That's a great find @tuapuikia - could you open a PR?
Hi,
I'm trying to override the index config defaults using the below:
However it seems to ignore the options for shards & replicas
Can you confirm that this is working? Am I missing something?