Skip to content

Commit cafab9c

Browse files
committed
fix search test case
1 parent 4b8a32a commit cafab9c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Classes/Search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function build()
9595

9696
$query_params = [];
9797

98-
$query_params["q"] = $this->q;
98+
$query_params["query"] = $this->q;
9999

100100
if($this->boost > 1) {
101101
$query_params["boost"] = $this->boost;

tests/SearchTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ protected function getExpected($q, $boost = 1)
2929
{
3030
$query = $this->getQueryArray();
3131

32+
$search_params = [];
33+
34+
$search_params["query"] = $q;
35+
36+
if($boost > 1){
37+
$search_params["boost"] = $boost;
38+
}
39+
3240
$query["body"]["query"]["bool"]["must"][] = [
33-
"query_string" => [
34-
"query" => $q,
35-
"boost" => $boost
36-
]
41+
"query_string" => $search_params
3742
];
3843

3944
return $query;

0 commit comments

Comments
 (0)