ElasticSearch upgrade for v1.x
We need to update to a newer ElasticSearch version (7.17) on the v1.x branch. The breaking changes can be found here. In practice this means the following tasks:
-
Update our docker files to use the newer version -
Update the DSL version -
Update our mapping to conform to the new version: -
ES 7 has removed mapping types: we need to simply remove these from our mapping: they are not used for identifying any resources (e.g. the index already tells if we are targeting materials or entries).
-
-
Update any deprecated DSL calls/response handling: -
hits.total is now an object -
hits.total is now by default accurately tracking hits only up to 10 000 items. To enable tracking all search results, we need to provide the option track_total_hits=True
. -
elasticsearch_dsl.utils.AttrDict is no longer considered a valid dict type by pydantic, must call .to_dict() -
Storing an empty list in ES is now working (in the previous version of ES or elasticsearch_dsl empty lists were stored as None
). This should be perfectly fine and the expected behaviour for ES, see e.g. [here] (https://www.elastic.co/guide/en/elasticsearch/reference/7.17/null-value.html). Modified the testtests/app/v1/routers/test_entries_edit.test_edit_all_properties
accordingly.
-
Edited by Lauri Himanen