Elasticsearch: Add support for V6 / one index type
Starting with ES 6.0.0, multiple mapping types within an index are no
longer supported. Replace the open and closed changes index types with
just one (type), for that V6 case. Name that single type '_doc', to help
prepare V6 indices in Gerrit for a potential yet smoother migration to
V7. -Choose such a name as it becomes the default one starting with V7.
Consistently do so as well for the accounts and groups indices. Doing so
has no negative impacts on the trivial way index types are used today.
Refer to [1] for all these matters considered herein. Stick to the V2
index type names for the V5 case, as the latter does not support names
starting with an underscore (such as '_doc' for V6+).
Set the _type field only for Elasticsearch V2 and V5 usage, as it is
deprecated starting with V6; cf. [2]. This is consistent with the above.
These were the sole breaking changes between Elasticsearch V5 and V6 for
the Gerrit ES client implementation. This change is also meant to
preserve potentially existing V2 /default integrations or deployments.
[1] https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html#_schedule_for_removal_of_mapping_types
[2] https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-type-field.html
Bug: Issue 9112
Change-Id: I92e6c74741976ef002aadded4e1915927aef46e5
8 files changed