Skip to content

Commit b375006

Browse files
committed
TASK: Remove _type argument, which is not needed for modern ES versions
1 parent d9c1b77 commit b375006

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\ElasticSearchClient;
1919
use Neos\ContentRepository\Domain\Service\ContextFactoryInterface;
2020
use Neos\Flow\Tests\FunctionalTestCase;
21+
use function RectorPrefix202304\dump;
2122

2223
abstract class BaseElasticsearchContentRepositoryAdapterTest extends FunctionalTestCase
2324
{
@@ -58,7 +59,13 @@ public function tearDown(): void
5859

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

0 commit comments

Comments
 (0)