Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/storage/db.py
Show First 20 Lines • Show All 358 Lines • ▼ Show 20 Lines | def origin_intrinsic_metadata_search_fulltext(self, terms, *, limit, | ||||
"JOIN LATERAL (SELECT {tsquery_template}) AS s(tsq) ON true " | "JOIN LATERAL (SELECT {tsquery_template}) AS s(tsq) ON true " | ||||
"WHERE to_tsvector('{regconfig}', metadata) @@ tsq " | "WHERE to_tsvector('{regconfig}', metadata) @@ tsq " | ||||
"ORDER BY ts_rank(oim.metadata_tsvector, tsq, 1) DESC " | "ORDER BY ts_rank(oim.metadata_tsvector, tsq, 1) DESC " | ||||
"LIMIT %s;" | "LIMIT %s;" | ||||
).format(keys=', '.join(keys), | ).format(keys=', '.join(keys), | ||||
regconfig=regconfig, | regconfig=regconfig, | ||||
tsquery_template=tsquery_template) | tsquery_template=tsquery_template) | ||||
cur.execute(query, tsquery_args + [limit]) | cur.execute(query, tsquery_args + [limit]) | ||||
yield from cur | yield from cursor_to_bytes(cur) | ||||
indexer_configuration_cols = ['id', 'tool_name', 'tool_version', | indexer_configuration_cols = ['id', 'tool_name', 'tool_version', | ||||
'tool_configuration'] | 'tool_configuration'] | ||||
@stored_procedure('swh_mktemp_indexer_configuration') | @stored_procedure('swh_mktemp_indexer_configuration') | ||||
def mktemp_indexer_configuration(self, cur=None): | def mktemp_indexer_configuration(self, cur=None): | ||||
pass | pass | ||||
Show All 21 Lines |