Remove trigram indexes and use ElasticSearch for searching merge requests and issues
We have various trigram indexes in place to allow efficient searching of merge requests and issues. These indexes take up a lot of space (35GB in case of the merge_requests
table) and are expensive to update.
We need to find a way to use ElasticSearch for searching merge requests and issues for all search features that we have (not just the search bar in the top header). We then need to find a way to disable and remove these indexes using a toggle. When re-enabling that toggle, the indexes should be re-created automatically (ideally, though we can require manual creation if really necessary).
This approach would bring us the following benefits:
- We can save ourselves at least 35GB of space for just the
merge_requests
table; even more if we also apply this to theissues
table and potentially other tables - Search should be much faster, as our current PostgreSQL based setup doesn't fare well when processing a lot of data and/or filters
- We dogfood ElasticSearch more