nextcloud / nextcloud/mail

Searching via search bar takes very long time in large mailboxes

Open
#10,448 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. to triage bug
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Steps to reproduce
  1. Go to a mailbox containing a lot of emails
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.