|
|
|
@ -57,7 +57,6 @@ def get_item_by_detailed_description(
|
|
|
|
# hardcode russian for now
|
|
|
|
# hardcode russian for now
|
|
|
|
# built-in postgress websearch_to_tsquery() is good
|
|
|
|
# built-in postgress websearch_to_tsquery() is good
|
|
|
|
# https://www.postgresql.org/docs/11/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES
|
|
|
|
# https://www.postgresql.org/docs/11/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES
|
|
|
|
# TODO: add requested search columns [0]
|
|
|
|
|
|
|
|
items_table = inspect(models.Item).local_table
|
|
|
|
items_table = inspect(models.Item).local_table
|
|
|
|
result = db.query(models.Item)
|
|
|
|
result = db.query(models.Item)
|
|
|
|
|
|
|
|
|
|
|
|
@ -65,7 +64,7 @@ def get_item_by_detailed_description(
|
|
|
|
if query.main_query is not None:
|
|
|
|
if query.main_query is not None:
|
|
|
|
result = result.filter(
|
|
|
|
result = result.filter(
|
|
|
|
items_table.c.geodata_search_ts.op("@@")(
|
|
|
|
items_table.c.geodata_search_ts.op("@@")(
|
|
|
|
func.websearch_to_tsquery('"russian"', main_query)
|
|
|
|
func.websearch_to_tsquery('"russian"', query.main_query)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
# filter by additionalfields (if present)
|
|
|
|
# filter by additionalfields (if present)
|
|
|
|
|