datashare
datashare copied to clipboard
feat: automatically apply elastic search settings
During deploy or install, automatically apllying settings to elastic search would prevent discrepancies and manual interventions to update the settings.
Currently it could be done with this curl
command:
-
curl -XPUT http://elasticsearch:9200/_settings -H "Content-Type: application/json" -d @src/main/resources/datashare_index_settings.json
-
curl -XPUT http://elasticsearch:9200/_settings -H "Content-Type: application/json" -d @src/main/resources/datashare_index_settings_windows.json
Example for applying current query default_fields
manually:
curl -XPUT http://elasticsearch:9200/_settings -H "Content-Type: application/json" -d'{ "index.query.default_field": [
"content",
"mentionNorm",
"content_translated.content",
"metadata.tika_metadata_author",
"metadata.tika_metadata_creator",
"metadata.tika_metadata_dc_creator",
"metadata.tika_metadata_dc_title",
"metadata.tika_metadata_message_from",
"metadata.tika_metadata_message_to",
"metadata.tika_metadata_meta_author",
"metadata.tika_metadata_subject",
"metadata.tika_metadata_title",
"metadata.tika_metadata_resourcename",
"name",
"path",
"tags"
]}'