mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-14 09:19:41 +00:00
add similarity test in search query when adding person
This commit is contained in:
@@ -75,14 +75,18 @@ class SimilarPersonMatcher
|
|||||||
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:lastName)) '
|
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:lastName)) '
|
||||||
. ' OR UNACCENT(LOWER(p.firstName)) LIKE UNACCENT(LOWER(:lastName)) '
|
. ' OR UNACCENT(LOWER(p.firstName)) LIKE UNACCENT(LOWER(:lastName)) '
|
||||||
. ' OR UNACCENT(LOWER(p.lastName)) LIKE UNACCENT(LOWER(:firstName)) '
|
. ' 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 =
|
$query =
|
||||||
$this->em
|
$this->em
|
||||||
->createQuery($dql)
|
->createQuery($dql)
|
||||||
->setParameter('firstName', $person->getFirstName())
|
->setParameter('firstName', $person->getFirstName())
|
||||||
->setParameter('lastName', $person->getLastName())
|
->setParameter('lastName', $person->getLastName())
|
||||||
|
->setParameter('fullName', $person->getFirstName() . ' ' . $person->getLastName())
|
||||||
->setParameter('centers', $centers)
|
->setParameter('centers', $centers)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user