mail
mail copied to clipboard
Improve search performance
Is your feature request related to a problem? Please describe.
Searching for emails is a sluggish experience and takes time to load. Even if the there are some emails cached locally already.
Describe the solution you'd like
The perceived performance of searching emails could be improved.
- [ ] Initially search only in emails that have already been loaded on the frontend until remote results come in.
- [ ] Limit the search to one month back first before searching the rest.
Describe alternatives you've considered
No response
Additional context
No response
Additional idea
- [x] ~Split the search endpoint into two: one for the db and one for the imap server. This way both could be executed at the same time which significantly reduces the time until the first results come in.~
The search is already done on the DB only if no body search query is included. The body filter has to be sent to IMAP as envelope bodies are not (yet) cached anywhere.
The PR at https://github.com/nextcloud/mail/pull/11055 should also help with the database search. The index over (normalized) email addresses can be used afterwards.