summary refs log tree commit diff
path: root/synapse/storage/search.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@fragile.org.uk>2018-04-09 17:21:34 +0100
committerNeil Johnson <neil@fragile.org.uk>2018-04-09 17:21:34 +0100
commit5e785d4d5b4137dfa596fde99c80ff94faff0a71 (patch)
treedaa6637c3c7db3b8f0fe1957f7719ffabb04e026 /synapse/storage/search.py
parentMerge branch 'release-v0.27.0' of https://github.com/matrix-org/synapse into ... (diff)
parentRevert "Merge pull request #3066 from matrix-org/rav/remove_redundant_metrics" (diff)
downloadsynapse-5e785d4d5b4137dfa596fde99c80ff94faff0a71.tar.xz
Merge branch 'develop' of https://github.com/matrix-org/synapse into release-v0.27.0
Diffstat (limited to 'synapse/storage/search.py')
-rw-r--r--synapse/storage/search.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index 984643b057..426cbe6e1a 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -75,8 +75,9 @@ class SearchStore(BackgroundUpdateStore):
 
         def reindex_search_txn(txn):
             sql = (
-                "SELECT stream_ordering, event_id, room_id, type, content, "
+                "SELECT stream_ordering, event_id, room_id, type, json, "
                 " origin_server_ts FROM events"
+                " JOIN event_json USING (event_id)"
                 " WHERE ? <= stream_ordering AND stream_ordering < ?"
                 " AND (%s)"
                 " ORDER BY stream_ordering DESC"
@@ -104,7 +105,8 @@ class SearchStore(BackgroundUpdateStore):
                     stream_ordering = row["stream_ordering"]
                     origin_server_ts = row["origin_server_ts"]
                     try:
-                        content = json.loads(row["content"])
+                        event_json = json.loads(row["json"])
+                        content = event_json["content"]
                     except Exception:
                         continue