mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add similarity test in search query when adding person
This commit is contained in:
parent
3599a94f94
commit
290a904991
@ -75,14 +75,18 @@ class SimilarPersonMatcher
|
||||
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:lastName)) '
|
||||
. ' OR UNACCENT(LOWER(p.firstName)) LIKE UNACCENT(LOWER(:lastName)) '
|
||||
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:firstName)) '
|
||||
. ' OR SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName))) >= 0.15 '
|
||||
. ' ) '
|
||||
. ' AND p.center IN (:centers)';
|
||||
. ' AND p.center IN (:centers)'
|
||||
. ' ORDER BY SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName))) DESC '
|
||||
;
|
||||
|
||||
$query =
|
||||
$this->em
|
||||
->createQuery($dql)
|
||||
->setParameter('firstName', $person->getFirstName())
|
||||
->setParameter('lastName', $person->getLastName())
|
||||
->setParameter('fullName', $person->getFirstName() . ' ' . $person->getLastName())
|
||||
->setParameter('centers', $centers)
|
||||
;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user