Fix land use group autofill

This commit is contained in:
Maciej Ziarkowski 2020-03-20 01:05:23 +00:00
parent bbd570ddbe
commit 786389a50b

View File

@ -30,9 +30,9 @@ function getLanduseGroupOptions(value: string, all: boolean = false) {
SELECT SELECT
landuse_id AS id, landuse_id AS id,
description AS value, description AS value,
ts_rank(to_tsvector(description), to_tsquery('simple', $1)) AS similarity ts_rank(to_tsvector('simple', description), to_tsquery('simple', $1)) AS similarity
FROM reference_tables.buildings_landuse_group FROM reference_tables.buildings_landuse_group
WHERE to_tsvector(description) @@ to_tsquery('simple', $1) WHERE to_tsvector('simple', description) @@ to_tsquery('simple', $1)
ORDER BY similarity DESC, description ORDER BY similarity DESC, description
`, [query] `, [query]
); );