diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-02-13 12:16:01 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-02-13 12:16:01 +0000 |
commit | a9b712e9dce119c65fe24913d2a79212ae07a354 (patch) | |
tree | 2c98b0b3d7d31c59ce41db257c3a18c5b3a2df03 /synapse/storage/search.py | |
parent | Factor out common code for search insert (diff) | |
parent | Merge pull request #2857 from matrix-org/erikj/upload_store (diff) | |
download | synapse-a9b712e9dce119c65fe24913d2a79212ae07a354.tar.xz |
Merge branch 'develop' into matthew/gin_work_mem
Diffstat (limited to 'synapse/storage/search.py')
-rw-r--r-- | synapse/storage/search.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py index eecf778516..7c80fab277 100644 --- a/synapse/storage/search.py +++ b/synapse/storage/search.py @@ -12,18 +12,19 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + from collections import namedtuple +import logging +import re import sys +import ujson as json + from twisted.internet import defer from .background_updates import BackgroundUpdateStore from synapse.api.errors import SynapseError from synapse.storage.engines import PostgresEngine, Sqlite3Engine -import logging -import re -import ujson as json - logger = logging.getLogger(__name__) @@ -280,10 +281,10 @@ class SearchStore(BackgroundUpdateStore): if isinstance(self.database_engine, PostgresEngine): sql = ( "INSERT INTO event_search" - " (event_id, room_id, key, vector, stream_ordering, " - " origin_server_ts)" + " (event_id, room_id, key, vector, stream_ordering, origin_server_ts)" " VALUES (?,?,?,to_tsvector('english', ?),?,?)" ) + args = (( entry.event_id, entry.room_id, entry.key, entry.value, entry.stream_ordering, entry.origin_server_ts, |