Skip to content

Commit

Permalink
Fixing issue with translateQuery. (#59)
Browse files Browse the repository at this point in the history
* Fixing issue with translateQuery.

* Applying style patch.

* Updating tests.
  • Loading branch information
Jeremy Sik authored and rayzor65 committed May 16, 2016
1 parent 94ef97e commit e7d483f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Controllers/EntityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ private function translateQuery($query)

foreach ($value[$fieldKey] as $fieldValue) {
if (! empty($fieldValue)) {
$snakeKey = snake_case(substr($key, 1));
$snakeKey = snake_case($key);
array_push($processedQuery['query']['bool']['must'],
[
'nested' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/EntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public function testGetAllPaginatedComplexSearch($path)
->with([
'index' => 'defaultIndex',
'type' => 'someTypeName',
'body' => ['query' => ['bool' => ['must' => [['match_phrase_prefix' => ['_all' => 'search term']], ['match_phrase_prefix' => ['author_id' => 'some UUID']], ['nested' => ['path' => 'tags', 'query' => ['bool' => ['must' => ['match_phrase_prefix' => ['tags.tag_id' => 'tag ID 1']]]]]], ['nested' => ['path' => 'tags', 'query' => ['bool' => ['must' => ['match_phrase_prefix' => ['tags.tag_id' => 'tag ID 2']]]]]]]]]],
'body' => ['query' => ['bool' => ['must' => [['match_phrase_prefix' => ['_all' => 'search term']], ['match_phrase_prefix' => ['author_id' => 'some UUID']], ['nested' => ['path' => '_tags', 'query' => ['bool' => ['must' => ['match_phrase_prefix' => ['_tags.tag_id' => 'tag ID 1']]]]]], ['nested' => ['path' => '_tags', 'query' => ['bool' => ['must' => ['match_phrase_prefix' => ['_tags.tag_id' => 'tag ID 2']]]]]]]]]],
])
->andReturn($resultsMock);

Expand Down

0 comments on commit e7d483f

Please sign in to comment.