Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

[SDPA-5015] Upgrade Elasticsearch Connector for compatibility with 7 #30

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
14 changes: 14 additions & 0 deletions .docker/Dockerfile.elasticsearch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM amazeeio/elasticsearch:7-latest
ARG ES_TPL

ENV ES_TPL=${ES_TPL:-elasticsearch.yml}

RUN bin/elasticsearch-plugin install analysis-kuromoji \
&& bin/elasticsearch-plugin install analysis-icu

COPY .docker/elasticsearch.yml .docker/elasticsearch.* /tmp/elasticsearch/

RUN mkdir -p config \
&& cp /tmp/elasticsearch/$ES_TPL config/elasticsearch.yml

ENV ES_JAVA_OPTS "-Xms1000m -Xmx1000m"
9 changes: 1 addition & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,13 @@
"license": "GPL-2.0-or-later",
"require": {
"drupal/search_api": "^1.11",
"drupal/elasticsearch_connector": "^6.0-alpha2",
"drupal/elasticsearch_connector": "^7.0@alpha",
"dpc-sdp/tide_core": "^2.0.0"
},
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
}
},
"extra": {
"patches": {
"drupal/elasticsearch_connector": {
"deleteMapping() throws undefined error - https://www.drupal.org/project/elasticsearch_connector/issues/2824539": "https://www.drupal.org/files/issues/2021-07-20/%5BdeleteMapping-throws-undefined-error%5D-%5B3224368%5D-%5B1%5D_0.patch"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public static function bulkDelete(IndexInterface $index, array $ids) {
$params['body'][] = [
'delete' => [
'_index' => $params['index'],
'_type' => $params['type'],
'_id' => $id,
],
];
Expand Down
5 changes: 3 additions & 2 deletions tests/behat/features/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Feature: Ensure Search API on Bay Elasticsearch work.
And the JSON node "hits" should exist
And the JSON node "hits.hits" should exist
And the JSON node "hits.hits[0]._index" should be equal to "elasticsearch_index_drupal_node"
And the JSON node "hits.hits[0]._type" should be equal to "node"
And the JSON node "hits.hits[0]._source" should exist
And the JSON node "hits.hits[0]._source.title[0]" should be equal to "TESTTITLEPUBLISHED"
And the JSON node "hits.hits[0]._source.body[0]" should be equal to "TESTBODY"
Expand All @@ -64,4 +63,6 @@ Feature: Ensure Search API on Bay Elasticsearch work.
Then the rest response status code should be 200
And the response should be in JSON
And the JSON node "hits" should exist
And the JSON node "hits.total" should be equal to "0"
And the JSON node "hits.total" should exist
And the JSON node "hits.total.value" should exist
And the JSON node "hits.total.value" should be equal to "0"