mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge remote-tracking branch 'origin/master' into issue434_endDate_enfantHorsMenage
This commit is contained in:
commit
c90e6231f9
@ -11,6 +11,7 @@ and this project adheres to
|
||||
## Unreleased
|
||||
|
||||
<!-- write down unreleased development here -->
|
||||
* [thirdparty] Extend the thirdparty search to thirdparty children (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/448)
|
||||
* [person]: AddPersons: allow creation of person or thirdparty only (no users) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
|
||||
* [person]: AddPersons: allow creation of person or thirdparty depending on allowed types (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
|
||||
* [person]: AddPersons: add suggestion of name when creating new person or thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
|
||||
|
@ -87,14 +87,24 @@ class ThirdPartyApiSearch implements SearchApiInterface
|
||||
foreach ($strs as $str) {
|
||||
if (!empty($str)) {
|
||||
$wheres[] = "(LOWER(UNACCENT(?)) <<% tparty.canonicalized OR
|
||||
tparty.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')";
|
||||
$whereArgs[] = [$str, $str];
|
||||
$pertinence[] = 'STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), tparty.canonicalized) + ' .
|
||||
"(tparty.canonicalized LIKE '%s' || LOWER(UNACCENT(?)) || '%')::int + " .
|
||||
tparty.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')
|
||||
OR
|
||||
(LOWER(UNACCENT(?)) <<% parent.canonicalized OR
|
||||
parent.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')
|
||||
";
|
||||
$whereArgs[] = [$str, $str, $str, $str];
|
||||
$pertinence[] = 'GREATEST(
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), tparty.canonicalized),
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), parent.canonicalized)
|
||||
) + ' .
|
||||
"GREATEST(
|
||||
(tparty.canonicalized LIKE '%s' || LOWER(UNACCENT(?)) || '%')::int,
|
||||
(parent.canonicalized LIKE '%s' || LOWER(UNACCENT(?)) || '%')::int
|
||||
) + " .
|
||||
// take postcode label into account, but lower than the canonicalized field
|
||||
"COALESCE((LOWER(UNACCENT(cmpc.label)) LIKE '%' || LOWER(UNACCENT(?)) || '%')::int * 0.3, 0) + " .
|
||||
"COALESCE((LOWER(UNACCENT(cmpc_p.label)) LIKE '%' || LOWER(UNACCENT(?)) || '%')::int * 0.3, 0)";
|
||||
$pertinenceArgs[] = [$str, $str, $str, $str];
|
||||
$pertinenceArgs[] = [$str, $str, $str, $str, $str, $str];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user