Skip to content

Commit

Permalink
Fixing named Match query test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainruaud committed Jul 12, 2024
1 parent e3d1036 commit 83fccfd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testAnonymousMatchQueryBuilder()
$this->assertEquals(MatchQuery::DEFAULT_MINIMUM_SHOULD_MATCH, $query['match']['searchField']['minimum_should_match']);
$this->assertEquals(MatchQuery::DEFAULT_BOOST_VALUE, $query['match']['searchField']['boost']);

$this->assertArrayNotHasKey('_name', $query['match']);
$this->assertArrayNotHasKey('_name', $query['match']['searchField']);
}

/**
Expand All @@ -58,8 +58,8 @@ public function testNamedMatchQueryBuilder()
$matchQuery = new MatchQuery('search text', 'searchField', MatchQuery::DEFAULT_BOOST_VALUE, 'queryName');
$query = $builder->buildQuery($matchQuery);

$this->assertArrayHasKey('_name', $query['match']);
$this->assertEquals('queryName', $query['match']['_name']);
$this->assertArrayHasKey('_name', $query['match']['searchField']);
$this->assertEquals('queryName', $query['match']['searchField']['_name']);
}

/**
Expand Down

0 comments on commit 83fccfd

Please sign in to comment.