[ELASTIC-17] Add supportfor current ES versions (7.x, 8.x) Created: 18/Jan/22  Updated: 18/Jan/22

Status: Open
Project: Elasticsearch
Component/s: None
Affects Version/s: 1.0.0
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: wolf bubenik Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Java 11
Magnolia 6.2.x
Elastic 7.x, especially 7.14 and newer


Template:
Acceptance criteria:
[ ]* Creating index and mappings works for current ES versions that do not support he mapping type any more.
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

The magnolia-es-configuration module contains ES API configs from version 6.0 to 7.3. As default it uses version 6.0.Using this default with new ES servers (7.13) causes errors on some REST calls. For instance the indexing of new documents fails with an error.

API configs for newer versions are missing in the module setup.

In these old versions the mapping supports a mapping type, that has been removed in versions 7.00 and newer.

See: https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html

When using ES with version 7.x we have to add the parameter "include_type_name=true" to the create index request path to be backward compatible. If missing we get an exception and the index cannot be created with a mapping. If we create the index without mapping we get the exception when adding a document to the index.

The create index request template can be found in the "query-manager" workspace at "/requests/standard/index/create".

As a workaround you may

  • provide the REST API configuration within our webapp resources at /elastic-configuration/elastic-api/<version>
  • add a UpdateTask that sets the missing include_type_name parameter to the create index request path
private Task _patchCreateIndexPath = new NodeBuilderTask(            "Patch for requests.standard.index.create", "", ErrorHandling.logging,             "query-manager",             "/requests/standard/index/create",             addOrSetProperty("path", "/{index}?include_type_name=true")    ); 

 

  • Note that this fix only works for ES version < 7.14

 


Generated at Mon Feb 12 01:46:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.