Skip to content

Commit

Permalink
Fix Smile-SA#3205, remove type parameter in order to compatibility wi…
Browse files Browse the repository at this point in the history
…th Elasticsearch 8
  • Loading branch information
vahonc committed Mar 26, 2024
1 parent f5168a0 commit fda404f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/module-elasticsuite-core/Index/Bulk/BulkRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']],
],
]));

Expand Down

0 comments on commit fda404f

Please sign in to comment.