SearchIndex: Implement Collections (WIP) #3810
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is another gradual improvement on top of #3556 and #3557.
This introduces the a collection that is meant to replace the current fulltext index. Again this is pretty much a work in progress but should show how this could work in the future.
Indexes themselves have evolved a bit more and provide a way to look up entries by regular expression.
A collection basically manages access to all the the involved indexes. It decides if an index is to be accessed as memory or file index. It also provides mechanisms to work on the collection, eg add or update data in it. Currently it is all implemented in a FulltextCollection which is our most complex index.
The FulltextCollection class still contains a bunch of stuff copied over from our old code that needs to be refactored. That's probably the next step. Once that is done I think it would make sense to move out some of the functionality into a reusable base class.
This PR is mostly to ensure I won't forget what I did here a couple of weeks ago.
Note: we should probably cherry-pick 12ebce9 into master since test autoloading is currently broken