Skip to content

Commit

Permalink
Merge pull request #35 from designmynight/fix-boost
Browse files Browse the repository at this point in the history
fix: closes #34 by determining the clause term key instead of using type
  • Loading branch information
Alasdair authored Feb 26, 2018
2 parents 1ceb6a5 + 079cdd8 commit 4cabe55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/QueryGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,11 @@ protected function applyBoostOption(array $clause, $value, $where): array
return $clause[$firstKey]['boost'] = $value;
}

$key = key($clause['term']);

$clause['term'] = [
'type' => [
'value' => $clause['term']['type'],
$key => [
'value' => $clause['term'][$key],
'boost' => $value
]
];
Expand Down

0 comments on commit 4cabe55

Please sign in to comment.