From fda404fc58a62fafea473e54d6d26ef99dd2df61 Mon Sep 17 00:00:00 2001 From: Vadym Honcharuk Date: Tue, 26 Mar 2024 19:24:43 +0200 Subject: [PATCH] Fix #3205, remove type parameter in order to compatibility with Elasticsearch 8 --- src/module-elasticsuite-core/Index/Bulk/BulkRequest.php | 6 +++--- .../Test/Unit/Index/IndexOperationTest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php b/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php index 8b89599cf..5c8aea311 100644 --- a/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php +++ b/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php @@ -55,7 +55,7 @@ public function getOperations() */ public function addDocument(IndexInterface $index, $docId, array $data) { - $this->bulkData[] = ['index' => ['_index' => $index->getName(), /*'_type' => '_doc',*/ '_id' => $docId]]; + $this->bulkData[] = ['index' => ['_index' => $index->getName(), '_id' => $docId]]; $this->bulkData[] = $data; return $this; @@ -78,7 +78,7 @@ public function addDocuments(IndexInterface $index, array $data) */ public function deleteDocument(IndexInterface $index, $docId) { - $this->bulkData[] = ['delete' => ['_index' => $index->getName(), /*'_type' => '_doc',*/ '_id' => $docId]]; + $this->bulkData[] = ['delete' => ['_index' => $index->getName(), '_id' => $docId]]; return $this; } @@ -100,7 +100,7 @@ public function deleteDocuments(IndexInterface $index, array $docIds) */ public function updateDocument(IndexInterface $index, $docId, array $data) { - $this->bulkData[] = ['update' => ['_index' => $index->getName(), /*'_type' => '_doc',*/ '_id' => $docId]]; + $this->bulkData[] = ['update' => ['_index' => $index->getName(), '_id' => $docId]]; $this->bulkData[] = ['doc' => $data]; return $this; diff --git a/src/module-elasticsuite-core/Test/Unit/Index/IndexOperationTest.php b/src/module-elasticsuite-core/Test/Unit/Index/IndexOperationTest.php index edc1d1b58..c58031861 100644 --- a/src/module-elasticsuite-core/Test/Unit/Index/IndexOperationTest.php +++ b/src/module-elasticsuite-core/Test/Unit/Index/IndexOperationTest.php @@ -124,8 +124,8 @@ public function testExecuteBulk() $this->clientMock->method('bulk')->will($this->returnValue([ 'errors' => true, 'items' => [ - ['index' => ['_index' => 'index', '_type' => 'type', '_id' => 'doc1']], - ['index' => ['_index' => 'index', '_type' => 'type', '_id' => 'doc2']], + ['index' => ['_index' => 'index', '_id' => 'doc1']], + ['index' => ['_index' => 'index', '_id' => 'doc2']], ], ]));