change strategy for searching: use the AND between words, instead of OR

This commit is contained in:
2022-03-29 12:42:17 +02:00
parent 961c0a867c
commit de4f65fede
3 changed files with 9 additions and 9 deletions

View File

@@ -45,7 +45,7 @@ class SearchUserApiProvider implements SearchApiInterface
$query
->setSelectKey('user')
->setSelectJsonbMetadata("jsonb_build_object('id', u.id)")
->setSelectPertinence('GREATEST(SIMILARITY(LOWER(UNACCENT(?)), u.label),
->setSelectPertinence('3 + GREATEST(SIMILARITY(LOWER(UNACCENT(?)), u.label),
SIMILARITY(LOWER(UNACCENT(?)), u.usernamecanonical))', [$pattern, $pattern])
->setFromClause('users AS u')
->setWhereClauses('