File tree Expand file tree Collapse file tree 2 files changed +45
-17
lines changed
app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder
dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog Expand file tree Collapse file tree 2 files changed +45
-17
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ protected function setUp(): void
86
86
* @param array $expected
87
87
* @param string|null $minimumShouldMatch
88
88
* @dataProvider buildDataProvider
89
+ * @dataProvider buildDataProviderForMatchPhrasePrefix
89
90
*/
90
91
public function testBuild (
91
92
string $ searchQuery ,
@@ -202,29 +203,57 @@ public function buildDataProvider(): array
202
203
],
203
204
'2<75% '
204
205
],
205
- 'match_phrase_prefix query with minimum_should_match ' => [
206
- '"fitness bottle" ' ,
206
+
207
+ ];
208
+ }
209
+
210
+ /**
211
+ * @return array
212
+ */
213
+ public function buildDataProviderForMatchPhrasePrefix ()
214
+ {
215
+ return [
216
+ 'match_phrase_prefix query with minimum_should_match ' => [
217
+ '"fitness bottle" ' ,
218
+ [
207
219
[
208
- [
209
- 'field ' => 'name ' ,
210
- 'boost ' => 5 ,
211
- 'matchCondition ' => 'match_phrase_prefix '
212
- ]
220
+ 'field ' => 'name ' ,
221
+ 'boost ' => 5 ,
222
+ 'matchCondition ' => 'match_phrase_prefix '
223
+ ]
224
+ ],
225
+ [
226
+ [
227
+ 'match_phrase_prefix ' => [
228
+ 'name ' => [
229
+ 'query ' => 'fitness bottle ' ,
230
+ 'boost ' => 6
231
+ ],
232
+ ],
213
233
],
234
+ ],
235
+ '2<75% '
236
+ ],
237
+ 'match_phrase_prefix query with no minimum_should_match ' => [
238
+ '"fitness bottle" ' ,
239
+ [
214
240
[
215
- [
216
- 'match_phrase_prefix ' => [
217
- 'name ' => [
218
- 'query ' => 'fitness bottle ' ,
219
- 'boost ' => 6 ,
220
- 'minimum_should_match ' => '2<75% ' ,
221
- ],
241
+ 'field ' => 'name ' ,
242
+ 'boost ' => 5 ,
243
+ 'matchCondition ' => 'match_phrase_prefix '
244
+ ]
245
+ ],
246
+ [
247
+ [
248
+ 'match_phrase_prefix ' => [
249
+ 'name ' => [
250
+ 'query ' => 'fitness bottle ' ,
251
+ 'boost ' => 6
222
252
],
223
253
],
224
254
],
225
- '2<75% '
226
255
]
227
- ];
256
+ ]] ;
228
257
}
229
258
230
259
/**
Original file line number Diff line number Diff line change @@ -1866,7 +1866,6 @@ public function testProductPartialNameFullTextSearchQuery()
1866
1866
1867
1867
$ prod1 = $ productRepository ->get ('simple1 ' );
1868
1868
$ prod2 = $ productRepository ->get ('simple2 ' );
1869
- $ prod3 = $ productRepository ->get ('simple3 ' );
1870
1869
$ response = $ this ->graphQlQuery ($ query );
1871
1870
$ this ->assertEquals (2 , $ response ['products ' ]['total_count ' ]);
1872
1871
You can’t perform that action at this time.
0 commit comments