Closed (fixed)
Project:
Elasticsearch Helper
Version:
8.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2019 at 13:43 UTC
Updated:
8 Sep 2023 at 12:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
a.dmitriiev commentedComment #3
a.dmitriiev commentedComment #4
a.dmitriiev commentedUnfortunately there is no version of the module that supports ElasticSearch version 7, that is why I am attaching the updated patch here. Remember to update "elasticsearch/elasticsearch" library to version 7 too, this could be done by adding this line to your root composer "elasticsearch/elasticsearch": "7.6.1 as 6.9.99" require section or just running the command:
composer require elasticsearch/elasticsearch:"7.6.1 as 6.9.99"
For the ones who are interested - here is the list of breaking changes in elastic 7 https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking... .
The patch covers a tiny part: creating of the indexes, putting Mapping and index content.
Comment #5
a.dmitriiev commentedForgot to change the version in composer.json
Comment #6
a.dmitriiev commentedUpdated patch for ES7, there are more places were type of mapping is used, but it is not needed anymore in ES7
Comment #7
jcnventuraRe-roll of the patch for those testing in conjunction with #3113356: Drupal 9 readiness
Comment #8
maijs commentedThe object oriented approach to index mapping has been introduced in version 7, and since then the best way to alter the data prior to an Elasticsearch operation was to use an event listener.
The patch attached allows event listeners to receive the index name and the index definition instance (incl. the mapping definition), and alter the existing mapping or add a new field.
The patch also includes an example event listener included in the
elasticsearch_helper_examplemodule.Comment #10
maijs commentedComment #11
maijs commentedEvent listeners now can access and modify the
index_definitionobject when an index is created. This allows custom modules to modify the index settings and the mapping.See an example in the
elasticsearch_helper_examplemodule - https://git.drupalcode.org/project/elasticsearch_helper/-/blob/8.x/examp...