Skip to content

Commit e90bdf1

Browse files
Merge pull request #407 from daniellienert/feature/elasticsearch-8-compatibility
FEATURE: Make the adapter Elasticsearch 8 compatible
2 parents d9c1b77 + 6379a50 commit e90bdf1

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

Classes/Driver/Version6/DocumentDriver.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public function delete(NodeInterface $node, string $identifier): array
3737
return [
3838
[
3939
'delete' => [
40-
'_type' =>'_doc',
4140
'_id' => $identifier
4241
]
4342
]

Classes/Driver/Version6/IndexerDriver.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public function document(string $indexName, NodeInterface $node, ElasticSearchDo
4141
return [
4242
[
4343
'update' => [
44-
'_type' => '_doc',
4544
'_id' => $document->getId(),
4645
'_index' => $indexName,
4746
'retry_on_conflict' => 3
@@ -70,7 +69,6 @@ public function document(string $indexName, NodeInterface $node, ElasticSearchDo
7069
return [
7170
[
7271
'index' => [
73-
'_type' => '_doc',
7472
'_id' => $document->getId(),
7573
'_index' => $indexName,
7674
]
@@ -110,7 +108,6 @@ public function fulltext(NodeInterface $node, array $fulltextIndexOfNode, string
110108
return [
111109
[
112110
'update' => [
113-
'_type' => '_doc',
114111
'_id' => $closestFulltextNodeDocumentIdentifier
115112
]
116113
],

Configuration/Settings.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,4 @@ Flowpack:
8080
nodeTypeMappingBuilder:
8181
className: 'Flowpack\ElasticSearch\ContentRepositoryAdaptor\Driver\Version6\Mapping\NodeTypeMappingBuilder'
8282
7.x: *v6x
83+
8.x: *v6x

Tests/Functional/BaseElasticsearchContentRepositoryAdapterTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ public function tearDown(): void
5858

5959
if (!$this->isIndexInitialized()) {
6060
// clean up any existing indices
61-
$this->searchClient->request('DELETE', '/' . self::TESTING_INDEX_PREFIX . '*');
61+
$aliases = $this->searchClient->request('GET', '_aliases')->getTreatedContent();
62+
63+
foreach ($aliases as $alias => $aliasConfiguration) {
64+
if(str_starts_with($alias, self::TESTING_INDEX_PREFIX)) {
65+
$this->searchClient->request('DELETE', '/' . $alias);
66+
}
67+
}
6268
}
6369
}
6470

0 commit comments

Comments
 (0)