Expand comment
This commit is contained in:
parent
764e79d051
commit
8fd8e72cec
|
@ -254,6 +254,12 @@ class SearchStore(BackgroundUpdateStore):
|
||||||
elif isinstance(self.database_engine, Sqlite3Engine):
|
elif isinstance(self.database_engine, Sqlite3Engine):
|
||||||
# We use CROSS JOIN here to ensure we use the right indexes.
|
# We use CROSS JOIN here to ensure we use the right indexes.
|
||||||
# https://sqlite.org/optoverview.html#crossjoin
|
# https://sqlite.org/optoverview.html#crossjoin
|
||||||
|
#
|
||||||
|
# We want to use the full text search index on event_search to
|
||||||
|
# extract all possible matches first, then lookup those matches
|
||||||
|
# in the events table to get the topological ordering. We need
|
||||||
|
# to use the indexes in this order because sqlite refuses to
|
||||||
|
# MATCH unless it uses the full text search index
|
||||||
sql = (
|
sql = (
|
||||||
"SELECT rank(matchinfo) as rank, room_id, event_id,"
|
"SELECT rank(matchinfo) as rank, room_id, event_id,"
|
||||||
" topological_ordering, stream_ordering"
|
" topological_ordering, stream_ordering"
|
||||||
|
|
Loading…
Reference in New Issue