config: allow modifying settings.query.default_field

The wildcard means we query all available fields by default.

https://www.elastic.co/guide/en/elasticsearch/reference/7.17/index-modules.html#dynamic-index-settings
https://www.elastic.co/guide/en/kibana/7.17/upgrade-assistant-api-default-field.html

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-09-25 14:24:23 +02:00
parent aedab4dae9
commit d9dc779dcc
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
2 changed files with 9 additions and 1 deletions

View File

@ -41,6 +41,8 @@ es_mapping_total_fields_limit: 1000
# Mappings for fields enforced by default template
es_default_template_mappings: {}
# Query optimization to not search throguh all fields. Can be a list.
es_default_query_default_field: '*'
# Tuning
es_node_concurrent_recoveries: 2

View File

@ -7,6 +7,7 @@
timeout: 40
- name: 'Set number of replicas to {{ es_number_of_replicas }} for all new indices'
register: wtg
uri:
url: 'http://localhost:{{ es_api_port }}/_template/default_template'
method: PUT
@ -17,7 +18,12 @@
"index_patterns": ["*"],
"mappings": {{ es_default_template_mappings | to_json }},
"settings": {
"index": { "mapping": { "total_fields": { "limit": {{ es_mapping_total_fields_limit | to_json }} } } },
"index": {
"query": { "default_field": {{ es_default_query_default_field | to_json }} },
"mapping": {
"total_fields": { "limit": {{ es_mapping_total_fields_limit | to_json }} }
}
},
"number_of_replicas": {{ es_number_of_replicas | to_json }},
"number_of_shards": {{ es_number_of_shards | to_json }}
}