mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-30 14:06:13 +00:00
cleaning
This commit is contained in:
parent
f3829d3390
commit
efee2d8b44
@ -1,21 +0,0 @@
|
||||
SELECT
|
||||
'tparty' AS key, jsonb_build_object('id', tparty.id) AS metadata, GREATEST(
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT('areams')), tparty.canonicalized),
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT('areams')), parent.canonicalized)
|
||||
) + GREATEST(
|
||||
(tparty.canonicalized LIKE '%s' || LOWER(UNACCENT('areams')) || '%')::int,
|
||||
(parent.canonicalized LIKE '%s' || LOWER(UNACCENT('areams')) || '%')::int
|
||||
) + COALESCE((LOWER(UNACCENT(cmpc.label)) LIKE '%' || LOWER(UNACCENT('areams')) || '%')::int * 0.3, 0) + COALESCE((LOWER(UNACCENT(cmpc_p.label)) LIKE '%' || LOWER(UNACCENT('areams')) || '%')::int * 0.3, 0) + 1 AS pertinence
|
||||
FROM chill_3party.third_party AS tparty
|
||||
LEFT JOIN chill_main_address cma ON cma.id = tparty.address_id
|
||||
LEFT JOIN chill_main_postal_code cmpc ON cma.postcode_id = cmpc.id
|
||||
LEFT JOIN chill_3party.third_party AS parent ON tparty.parent_id = parent.id
|
||||
LEFT JOIN chill_main_address cma_p ON parent.address_id = cma_p.id
|
||||
LEFT JOIN chill_main_postal_code cmpc_p ON cma_p.postcode_id = cmpc.id
|
||||
WHERE (tparty.active IS TRUE) AND (((LOWER(UNACCENT('areams')) <<% tparty.canonicalized OR
|
||||
tparty.canonicalized LIKE '%' || LOWER(UNACCENT('areams')) || '%')
|
||||
OR
|
||||
(LOWER(UNACCENT('areams')) <<% parent.canonicalized OR
|
||||
parent.canonicalized LIKE '%' || LOWER(UNACCENT('areams')) || '%'))
|
||||
AND tparty.active IS TRUE and (parent.active IS TRUE OR parent IS NULL))
|
||||
ORDER BY pertinence DESC LIMIT 50 OFFSET 0;
|
@ -1,21 +0,0 @@
|
||||
SELECT
|
||||
'tparty' AS key, jsonb_build_object('id', tparty.id) AS metadata, GREATEST(
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT('areams')), tparty.canonicalized),
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT('areams')), parent.canonicalized)
|
||||
) + GREATEST(
|
||||
(tparty.canonicalized LIKE '%s' || LOWER(UNACCENT('areams')) || '%')::int,
|
||||
(parent.canonicalized LIKE '%s' || LOWER(UNACCENT('areams')) || '%')::int
|
||||
) + COALESCE((LOWER(UNACCENT(cmpc.label)) LIKE '%' || LOWER(UNACCENT('areams')) || '%')::int * 0.3, 0) + COALESCE((LOWER(UNACCENT(cmpc_p.label)) LIKE '%' || LOWER(UNACCENT('areams')) || '%')::int * 0.3, 0) + 1 AS pertinence
|
||||
FROM chill_3party.third_party AS tparty
|
||||
LEFT JOIN chill_main_address cma ON cma.id = tparty.address_id
|
||||
LEFT JOIN chill_main_postal_code cmpc ON cma.postcode_id = cmpc.id
|
||||
LEFT JOIN chill_3party.third_party AS parent ON tparty.parent_id = parent.id
|
||||
LEFT JOIN chill_main_address cma_p ON parent.address_id = cma_p.id
|
||||
LEFT JOIN chill_main_postal_code cmpc_p ON cma_p.postcode_id = cmpc_p.id
|
||||
WHERE (tparty.active IS TRUE) AND (((LOWER(UNACCENT('areams')) <<% tparty.canonicalized OR
|
||||
tparty.canonicalized LIKE '%' || LOWER(UNACCENT('areams')) || '%')
|
||||
OR
|
||||
(LOWER(UNACCENT('areams')) <<% parent.canonicalized OR
|
||||
parent.canonicalized LIKE '%' || LOWER(UNACCENT('areams')) || '%'))
|
||||
AND tparty.active IS TRUE and (parent.active IS TRUE OR parent IS NULL))
|
||||
ORDER BY pertinence DESC LIMIT 50 OFFSET 0;
|
@ -1,19 +0,0 @@
|
||||
SELECT
|
||||
'tparty' AS key, jsonb_build_object('id', tparty.id) AS metadata, GREATEST(
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT('areams')), tparty.canonicalized),
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT('areams')), parent.canonicalized)
|
||||
) + GREATEST(
|
||||
(tparty.canonicalized LIKE '%s' || LOWER(UNACCENT('areams')) || '%')::int,
|
||||
(parent.canonicalized LIKE '%s' || LOWER(UNACCENT('areams')) || '%')::int
|
||||
) + COALESCE((LOWER(UNACCENT(cmpc.label)) LIKE '%' || LOWER(UNACCENT('areams')) || '%')::int * 0.3, 0) + 1 AS pertinence
|
||||
FROM chill_3party.third_party AS tparty
|
||||
LEFT JOIN chill_3party.third_party AS parent ON tparty.parent_id = parent.id
|
||||
LEFT JOIN chill_main_address cma ON cma.id = COALESCE(parent.address_id, tparty.address_id)
|
||||
LEFT JOIN chill_main_postal_code cmpc ON cma.postcode_id = cmpc.id
|
||||
WHERE (((LOWER(UNACCENT('areams')) <<% tparty.canonicalized OR
|
||||
tparty.canonicalized LIKE '%' || LOWER(UNACCENT('areams')) || '%')
|
||||
OR
|
||||
(LOWER(UNACCENT('areams')) <<% parent.canonicalized OR
|
||||
parent.canonicalized LIKE '%' || LOWER(UNACCENT('areams')) || '%'))
|
||||
AND tparty.active IS TRUE and (parent.active IS TRUE OR parent IS NULL))
|
||||
ORDER BY pertinence DESC, tparty.id ASC LIMIT 500 OFFSET 0;
|
Loading…
x
Reference in New Issue
Block a user