Skip to content

fix(search): search unified search terms with spaces as a whole - #14005

Open
GVodyanov wants to merge 1 commit into
mainfrom
fix/unified-search-full-term
Open

GVodyanov wants to merge 1 commit into
mainfrom
fix/unified-search-full-term

Conversation

@GVodyanov

Copy link
Copy Markdown
Contributor

Mail's unified search provider only searched for the first word of the term. Searching "QA Invite" searched for "QA", and "Re: invoice" for "Re", so results included every message containing that first word.

FilteringProvider put the term into the filter string unencoded, and that string is split on spaces and colons. The term and the person filter addresses are now URL encoded, which the filter string parser already decodes. Encoding the addresses also keeps a + in an address from turning into a space.

How to test

  1. Have a few messages whose subjects share their first word, e.g. "QA Invite …" and "QA Newsletter …"
  2. Search "QA Invite" in the unified search bar
  3. Only the "QA Invite …" messages are listed (before: every "QA …" message)
  4. Single-word searches return the same results as before

Found during the QA round in #13797. AI-assisted (Claude Code); reviewed and tested by me.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

The term was put into the filter string unencoded, and the filter string
is split on spaces and colons. Searching "QA invite" therefore only
searched for "QA", and "Re: invoice" for "Re". Values are now URL encoded,
which the filter string parser already decodes. Person filter addresses
are encoded too, so a "+" in an address is no longer turned into a space.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
@GVodyanov GVodyanov self-assigned this Nov 1, 2026
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Nov 1, 2026
@kesselb

kesselb commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Thanks,

I prepare a patch for a similar problem, but forgot about it #14008 🙈

Could you please switch this PR to rawurlencode and trim the term before encoding?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants