mail icon indicating copy to clipboard operation
mail copied to clipboard

Improve search performance

Open st3iny opened this issue 10 months ago • 2 comments

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.

  1. [ ] Initially search only in emails that have already been loaded on the frontend until remote results come in.
  2. [ ] Limit the search to one month back first before searching the rest.

Describe alternatives you've considered

No response

Additional context

No response

st3iny avatar Feb 18 '25 07:02 st3iny

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.

st3iny avatar Feb 26 '25 12:02 st3iny

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.

st3iny avatar May 26 '25 13:05 st3iny