File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -251,11 +251,16 @@ private function addCreatorFilter(): void
251251 private function addDifficultyFilter ()
252252 {
253253 if ($ this ->includes ->difficulty !== null ) {
254- $ this ->nested ->must (['match ' => ['beatmaps.version ' => ['query ' => $ this ->includes ->difficulty , 'operator ' => 'and ' ]]]);
254+ $ params = static ::isQuoted ($ this ->includes ->difficulty )
255+ ? ['match_phrase ' => ['beatmaps.version ' => $ this ->includes ->difficulty ]]
256+ : ['match ' => ['beatmaps.version ' => ['query ' => $ this ->includes ->difficulty , 'operator ' => 'and ' ]]];
257+ $ this ->nested ->must ($ params );
255258 }
256259
260+ // difficulty excludes if any single beatmap matches since requiring all the difficulties to have the matching phrase would be weird.
257261 if ($ this ->excludes ->difficulty !== null ) {
258- $ this ->nestedMustNot ->should (['match ' => ['beatmaps.version ' => ['query ' => $ this ->excludes ->difficulty , 'operator ' => 'or ' ]]]);
262+ $ matcher = static ::isQuoted ($ this ->excludes ->difficulty ) ? 'match_phrase ' : 'match ' ;
263+ $ this ->nestedMustNot ->should ([$ matcher => ['beatmaps.version ' => $ this ->excludes ->difficulty ]]);
259264 }
260265 }
261266
You can’t perform that action at this time.
0 commit comments