mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
fix canonicalization and show only active children in form
This commit is contained in:
@@ -20,9 +20,14 @@ class ThirdPartyApiSearch implements SearchApiInterface
|
||||
return (new SearchApiQuery)
|
||||
->setSelectKey('tparty')
|
||||
->setSelectJsonbMetadata("jsonb_build_object('id', tparty.id)")
|
||||
->setSelectPertinence("SIMILARITY(?, LOWER(UNACCENT(tparty.name)))", [ $pattern ])
|
||||
->setSelectPertinence("GREATEST(".
|
||||
"STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), tparty.canonicalized),".
|
||||
"(tparty.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')::int".
|
||||
")", [ $pattern, $pattern ])
|
||||
->setFromClause('chill_3party.third_party AS tparty')
|
||||
->setWhereClause('SIMILARITY(LOWER(UNACCENT(?)), LOWER(UNACCENT(tparty.name))) > 0.20', [ $pattern ])
|
||||
->setWhereClause("tparty.active IS TRUE ".
|
||||
"AND (LOWER(UNACCENT(?)) <<% tparty.canonicalized OR ".
|
||||
"tparty.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')", [ $pattern, $pattern ])
|
||||
;
|
||||
}
|
||||
|
||||
@@ -33,7 +38,7 @@ class ThirdPartyApiSearch implements SearchApiInterface
|
||||
|
||||
public function prepare(array $metadatas): void
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function supportsResult(string $key, array $metadatas): bool
|
||||
|
Reference in New Issue
Block a user