mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
thirdparty search: adapt pertinence select clause for searching into children
This commit is contained in:
parent
bc99c85802
commit
f5bc8dca5e
@ -93,12 +93,18 @@ class ThirdPartyApiSearch implements SearchApiInterface
|
|||||||
parent.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')
|
parent.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')
|
||||||
";
|
";
|
||||||
$whereArgs[] = [$str, $str, $str, $str];
|
$whereArgs[] = [$str, $str, $str, $str];
|
||||||
$pertinence[] = 'STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), tparty.canonicalized) + ' .
|
$pertinence[] = "GREATEST(
|
||||||
"(tparty.canonicalized LIKE '%s' || LOWER(UNACCENT(?)) || '%')::int + " .
|
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
|
// 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.label)) LIKE '%' || LOWER(UNACCENT(?)) || '%')::int * 0.3, 0) + " .
|
||||||
"COALESCE((LOWER(UNACCENT(cmpc_p.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