@@ 166-177 (lines=12) @@ | ||
163 | /** |
|
164 | * @group unit |
|
165 | */ |
|
166 | public function testAddWeightFunction(): void |
|
167 | { |
|
168 | $filter = new Term(['price' => 4.5]); |
|
169 | $query = new FunctionScore(); |
|
170 | $query->addWeightFunction(5.0, $filter); |
|
171 | ||
172 | $sameFilter = new Term(['price' => 4.5]); |
|
173 | $sameQuery = new FunctionScore(); |
|
174 | $sameQuery->addWeightFunction(5.0, $sameFilter); |
|
175 | ||
176 | $this->assertEquals($query->toArray(), $sameQuery->toArray()); |
|
177 | } |
|
178 | ||
179 | /** |
|
180 | * @group unit |
|
@@ 182-193 (lines=12) @@ | ||
179 | /** |
|
180 | * @group unit |
|
181 | */ |
|
182 | public function testLegacyFilterAddWeightFunction(): void |
|
183 | { |
|
184 | $query = new FunctionScore(); |
|
185 | $filter = new Term(['price' => 4.5]); |
|
186 | $query->addWeightFunction(5.0, $filter); |
|
187 | ||
188 | $sameQuery = new FunctionScore(); |
|
189 | $sameFilter = new Term(['price' => 4.5]); |
|
190 | $sameQuery->addWeightFunction(5.0, $sameFilter); |
|
191 | ||
192 | $this->assertEquals($query->toArray(), $sameQuery->toArray()); |
|
193 | } |
|
194 | ||
195 | /** |
|
196 | * @group functional |