Searching via search bar takes very long time in large mailboxes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- Go to a mailbox containing a lot of emails
- Search for something using the search bar
Expected behavior
You get a results in an acceptable amount of time.
Actual behavior
You get no results.
Mail app version
4.0.7
Nextcloud version
30.0.2
Mailserver or service
dovecot (imap)
Operating system
freebsd
PHP engine version
PHP 8.2
Nextcloud memory caching
'memcache.local' => '\OC\Memcache\APCu', 'memcache.locking' => '\OC\Memcache\Redis',
Web server
Nginx
Database
MariaDB
Additional info
The problem is because it also defaults to searching in the mail body (which is probably very expensive). Searching via the "Extra Settings" window (next to the bar) and using only one field returns results extremely quickly also in very very large mailboxes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the search-bar request path and compare it with the Extra Settings search that limits fields. Reproduce against a large mailbox using the reported Nextcloud Mail, Dovecot/IMAP, and MariaDB setup, then trace why body search is included by default. Done means searches return results in an acceptable time without regressing field-specific searches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mariadb, php
- Domain
- backend, frontend, performance, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100