mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-31 03:54:36 -04:00
Keep FTS indexes up to date. Only search through rooms currently joined
This commit is contained in:
parent
c85c912562
commit
61561b9df7
6 changed files with 55 additions and 12 deletions
|
@ -21,11 +21,16 @@ from synapse.api.constants import KnownRoomEventKeys, SearchConstraintTypes
|
|||
|
||||
class SearchStore(SQLBaseStore):
|
||||
@defer.inlineCallbacks
|
||||
def search_msgs(self, constraints):
|
||||
def search_msgs(self, room_ids, constraints):
|
||||
clauses = []
|
||||
args = []
|
||||
fts = None
|
||||
|
||||
clauses.append(
|
||||
"room_id IN (%s)" % (",".join(["?"] * len(room_ids)),)
|
||||
)
|
||||
args.extend(room_ids)
|
||||
|
||||
for c in constraints:
|
||||
local_clauses = []
|
||||
if c.search_type == SearchConstraintTypes.FTS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue