summary refs log tree commit diff
path: root/synapse/handlers/search.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Include user membership on events (#17282)Richard van der Hoff2024-06-131-4/+0
| | | | | MSC4115 has now completed FCP, so we can enable it by default and switch to the stable identifier.
* Add support for MSC4115 (#17104)Richard van der Hoff2024-04-291-4/+16
| | | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Add new module API for adding custom fields to events `unsigned` section ↵Erik Johnston2023-10-271-4/+4
| | | | (#16549)
* Pass the requester during event serialization. (#15174)Quentin Gliech2023-03-061-15/+28
| | | | This allows Synapse to properly include the transaction ID in the unsigned data of events.
* Use StrCollection in place of Collection[str] in (most) handlers code. (#14922)Patrick Cloke2023-01-261-4/+4
| | | | Due to the increased safety of StrCollection over Collection[str] and Sequence[str].
* Improve /sync performance of when passing filters with empty arrays. (#14786)Patrick Cloke2023-01-091-1/+1
| | | | | | | | | | | | | | | | This has two related changes: * It enables fast-path processing for an empty filter (`[]`) which was previously only used for wildcard not-filters (`["*"]`). * It special cases a `/sync` filter with no-rooms to skip all room processing, previously we would partially skip processing, but would generally still calculate intermediate values for each room which were then unused. Future changes might consider further optimizations: * Skip calculating per-room account data when all rooms are filtered (currently this is thrown away). * Make similar improvements to other endpoints which support filters.
* Move `StateFilter` to `synapse.types` (#14668)David Robertson2022-12-121-1/+1
| | | | | * Move `StateFilter` to `synapse.types` * Changelog
* Reduce the amount of state we pull from the DB (#12811)Erik Johnston2022-06-061-1/+1
|
* Rename storage classes (#12913)Erik Johnston2022-05-311-7/+7
|
* Fix up `state_store` naming (#12871)Erik Johnston2022-05-251-2/+2
|
* Add `StreamKeyType` class and replace string literals with constants (#12567)Andrew Morgan2022-05-161-5/+5
|
* Remove unused `# type: ignore`s (#12531)David Robertson2022-04-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | Over time we've begun to use newer versions of mypy, typeshed, stub packages---and of course we've improved our own annotations. This makes some type ignore comments no longer necessary. I have removed them. There was one exception: a module that imports `select.epoll`. The ignore is redundant on Linux, but I've kept it ignored for those of us who work on the source tree using not-Linux. (#11771) I'm more interested in the config line which enforces this. I want unused ignores to be reported, because I think it's useful feedback when annotating to know when you've fixed a problem you had to previously ignore. * Installing extras before typechecking Lacking an easy way to install all extras generically, let's bite the bullet and make install the hand-maintained `all` extra before typechecking. Now that https://github.com/matrix-org/backend-meta/pull/6 is merged to the release/v1 branch.
* Remove experimental configuration flag for MSC3666. (#12436)Patrick Cloke2022-04-111-17/+13
|
* Move get_bundled_aggregations to relations handler. (#12237)Patrick Cloke2022-03-181-1/+2
| | | | | The get_bundled_aggregations code is fairly high-level and uses a lot of store methods, we move it into the handler as that seems like a better fit.
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-1/+1
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Upgrade mypy to version 0.931 (#12030)Sean Quah2022-02-181-1/+1
| | | Upgrade mypy to 0.931, mypy-zope to 0.3.5 and fix new complaints.
* Refactor search code to reduce function size. (#11991)Patrick Cloke2022-02-151-219/+424
| | | | | | | | | Splits the search code into a few logical functions instead of a single unreadable function. There are also a few additional changes for readability. After refactoring it was clear to see there were some unused and unnecessary variables, which were simplified.
* Experimental support to include bundled aggregations in search results ↵Patrick Cloke2022-02-081-5/+24
| | | | (MSC3666) (#11837)
* Improvements to bundling aggregations. (#11815)Patrick Cloke2022-01-261-22/+23
| | | | | | | | | | | This is some odds and ends found during the review of #11791 and while continuing to work in this code: * Return attrs classes instead of dictionaries from some methods to improve type safety. * Call `get_bundled_aggregations` fewer times. * Adds a missing assertion in the tests. * Do not return empty bundled aggregations for an event (preferring to not include the bundle at all, as the docstring states).
* Bundle aggregations outside of the serialization method. (#11612)Patrick Cloke2022-01-071-6/+4
| | | | | | | | This makes the serialization of events synchronous (and it no longer access the database), but we must manually calculate and provide the bundled aggregations. Overall this should cause no change in behavior, but is prep work for other improvements.
* Support filtering by relations per MSC3440 (#11236)Patrick Cloke2021-11-091-3/+5
| | | | Adds experimental support for `relation_types` and `relation_senders` fields for filters.
* Refactor `Filter` to handle fields according to data being filtered. (#11194)Patrick Cloke2021-10-271-6/+6
| | | | This avoids filtering against fields which cannot exist on an event source. E.g. presence updates don't have a room.
* Remove the deprecated BaseHandler. (#11005)Patrick Cloke2021-10-081-4/+5
| | | | | | | | The shared ratelimit function was replaced with a dedicated RequestRatelimiter class (accessible from the HomeServer object). Other properties were copied to each sub-class that inherited from BaseHandler.
* Use direct references for configuration variables (part 6). (#10916)Patrick Cloke2021-09-291-1/+1
|
* Use inline type hints in `handlers/` and `rest/`. (#10382)Jonathan de Jong2021-07-161-4/+4
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Import HomeServer from the proper module. (#9665)Patrick Cloke2021-03-231-1/+1
|
* Add type hints to various handlers. (#9223)Patrick Cloke2021-01-261-16/+22
| | | | With this change all handlers except the e2e_* ones have type hints enabled.
* Fix typos and spelling errors. (#8639)Patrick Cloke2020-10-231-1/+1
|
* Make token serializing/deserializing async (#8427)Erik Johnston2020-09-301-4/+4
| | | The idea is that in future tokens will encode a mapping of instance to position. However, we don't want to include the full instance name in the string representation, so instead we'll have a mapping between instance name and an immutable integer ID in the DB that we can use instead. We'll then do the lookup when we serialize/deserialize the token (we could alternatively pass around an `Instance` type that includes both the name and ID, but that turns out to be a lot more invasive).
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-1/+1
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Convert streams to async. (#8014)Patrick Cloke2020-08-041-1/+1
|
* Fix up types and comments that refer to Deferreds. (#7945)Patrick Cloke2020-07-241-3/+4
|
* Convert search code to async/await. (#7460)Patrick Cloke2020-05-111-24/+20
|
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-211-4/+4
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* Add `local_current_membership` table (#6655)Erik Johnston2020-01-151-1/+1
| | | | | | | Currently we rely on `current_state_events` to figure out what rooms a user was in and their last membership event in there. However, if the server leaves the room then the table may be cleaned up and that information is lost. So lets add a table that separately holds that information.
* Prevent message search in upgraded rooms we're not in (#6385)Andrew Morgan2019-12-111-9/+25
|
* Update black to 19.10b0 (#6304)Amber Brown2019-11-011-8/+4
| | | * update version of black and also fix the mypy config being overridden
* Port to use state storageErik Johnston2019-10-301-5/+7
|
* Replace returnValue with return (#5736)Amber Brown2019-07-231-8/+6
|
* Run Black. (#5482)Amber Brown2019-06-201-67/+62
|
* Allow client event serialization to be asyncErik Johnston2019-05-141-19/+23
|
* Apply suggestions from code reviewRichard van der Hoff2019-01-241-1/+1
| | | Co-Authored-By: anoadragon453 <1342360+anoadragon453@users.noreply.github.com>
* Fix a bug with single-room search searching all roomsAndrew Morgan2019-01-221-32/+10
| | | | | * Create a new method for getting predecessor rooms * Remove formatting change
* Search for messages across predecessor roomsAndrew Morgan2019-01-181-0/+69
| | | | Signed-off-by: Andrew Morgan <andrew@amorgan.xyz>
* Add an option to disable search for homeservers which may not be interested ↵Travis Ralston2018-12-041-0/+3
| | | | | | in it (#4230) This is useful for homeservers not intended for users, such as bot-only homeservers or ones that only process IoT data.
* Fix search 500ing (#4122)Amber Brown2018-10-311-2/+6
|
* Port handlers/ to Python 3 (#3803)Amber Brown2018-09-071-7/+7
|
* make /context lazyload & filter aware (#3567)Matthew Hodgson2018-07-271-1/+1
| | | make /context lazyload & filter aware.
* run isortAmber Brown2018-07-091-9/+8
|
* Also log number of events for serach contextErik Johnston2018-06-221-0/+5
|
* Add some logging to search queriesErik Johnston2018-06-221-0/+9
|
* Consistently use six's iteritems and wrap lazy keys/values in list() if ↵Amber Brown2018-05-311-1/+1
| | | | they're not meant to be lazy (#3307)
* replace 'except:' with 'except Exception:'Richard van der Hoff2017-10-231-1/+1
| | | | what could possibly go wrong
* move filter_events_for_client out of base handlerMark Haines2016-05-111-8/+9
|
* Run filter_events_for_clientDavid Baker2016-04-271-4/+4
| | | | so we don't accidentally mail out events people shouldn't see
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Include approximate count of search resultsErik Johnston2015-12-111-1/+7
|
* Merge pull request #405 from matrix-org/erikj/search-tsErik Johnston2015-12-081-6/+4
|\ | | | | Change the result dict to be a list in /search response
| * Change the result tict to be a listErik Johnston2015-12-011-6/+4
| |
* | Search: Don't disregard grouping info in pagination tokensErik Johnston2015-12-011-3/+12
|/
* Tidy up a bitErik Johnston2015-12-011-8/+9
|
* Allow paginating search ordered by recentsErik Johnston2015-11-301-68/+60
|
* Return words to highlight in search resultsErik Johnston2015-11-271-3/+16
|
* Add option to include the current room stateErik Johnston2015-11-201-0/+24
|
* Optionally include historic profile infoErik Johnston2015-11-201-1/+30
|
* Be explicit about what we're doingErik Johnston2015-11-051-1/+1
|
* Remove redundant testErik Johnston2015-11-051-1/+0
|
* Increment by one, not fiveErik Johnston2015-11-051-1/+1
|
* COMMENTSErik Johnston2015-11-051-4/+26
|
* Implement basic pagination for search resultsErik Johnston2015-11-051-13/+65
|
* Implement order and group byErik Johnston2015-11-041-17/+109
|
* Make search API honour limit set in filterErik Johnston2015-10-291-0/+3
|
* Optionally return event contexts with search resultsErik Johnston2015-10-281-1/+52
|
* RenameErik Johnston2015-10-221-3/+3
|
* Use namedtuple as return valueErik Johnston2015-10-221-1/+3
|
* Filter room ids before hitting the databaseErik Johnston2015-10-211-1/+1
|
* Filter search resultsErik Johnston2015-10-211-2/+7
|
* Remove unused importErik Johnston2015-10-161-3/+1
|
* Remove duplicate _filter_events_for_clientErik Johnston2015-10-161-46/+0
|
* docstringErik Johnston2015-10-161-0/+10
|
* Make 'keys' optionalErik Johnston2015-10-141-1/+3
|
* More TODO markersErik Johnston2015-10-141-0/+3
|
* Add TODO markersErik Johnston2015-10-141-1/+4
|
* Remove constraints in preperation of using filtersErik Johnston2015-10-131-51/+10
|
* Search left rooms tooErik Johnston2015-10-131-5/+2
|
* Filter events to only thsoe that the user is allowed to seeErik Johnston2015-10-121-6/+10
|
* Remove unused room_id parameterErik Johnston2015-10-121-1/+49
|
* PEP8Erik Johnston2015-10-121-2/+9
|
* Keep FTS indexes up to date. Only search through rooms currently joinedErik Johnston2015-10-121-9/+22
|
* Add basic full text search impl.Erik Johnston2015-10-091-0/+95