Skip to content

Commit

Permalink
EWPP-2630: Revert search expression for delete endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hernani Borges de Freitas committed Nov 22, 2022
1 parent a180b12 commit ee3fe1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public function deleteAllIndexItems(IndexInterface $index, $datasource_id = NULL

$page = 1;
while (TRUE) {
$result = $this->getClient()->search(NULL, NULL, ['bool' => ['must' => ['term' => ['SEARCH_API_SITE_HASH' => Utility::getSiteHash()]]]], NULL, NULL, $page++);
$result = $this->getClient()->search(NULL, NULL, ['term' => ['SEARCH_API_SITE_HASH' => Utility::getSiteHash()]], NULL, NULL, $page++);
$item_ids = array_map(function (Document $document) use ($index) {
$destructed_reference = Utility::destructReference($document->getReference());
$site_hash = $destructed_reference[0] ?? NULL;
Expand Down
4 changes: 3 additions & 1 deletion tests/src/Kernel/BackendSearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ public function testLocalSearch(): void {
$result_items = $response->getResultItems();
$this->assertCount(2, $result_items);
$this->assertEquals(2, $response->getResultCount());
$first_result = reset($result_items);
$first_result = array_shift($result_items);
$this->assertEquals('entity:entity_test_mulrev_changed/2:en', $first_result->getId());
$second_result = array_shift($result_items);
$this->assertEquals('entity:entity_test_mulrev_changed/3:en', $second_result->getId());

// Search with a filter.
$query = $this->index->query();
Expand Down

0 comments on commit ee3fe1d

Please sign in to comment.