nextcloud / nextcloud/server

[Bug]: "Search everywhere" returns no result if search term is short

Open
#56,859 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 32-feedback bug
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

When the search term is short (< 3 char), the search everywhere page (/apps/files/search?query=xx) shows no result instead of a good error feedback. This can cause very confusing behavior.

Take this screen recording from the demo site for example,

  1. User searched for "ne" => got result => good
  2. User clicked "search everywhere", probably expect to get more result => instead, saw a "no result" screen
  3. User enter more chars and the result behave normally

https://github.com/user-attachments/assets/d1fe5766-b71d-42a3-b724-7e97ff4603f6

Steps to reproduce
  1. Navigate to /apps/files/search?query=xx and observe that it will never return a result no matter what the query is
Expected behavior

Not really sure,
Maybe we should show another error message, but it will still be confusing consider that clicking "search everywhere" erase the result.
Or maybe we should just search anyway

Additional info

I discovered this issue because I'm dealing with CJK characters, I also noticed that an PR #21777 a while ago reduced search limit to 2 chars, is there any reason that this page has the 3-char limit?

As for the env, It's reproducible on the demo site, so the env is whatever that env is.

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

Reproduce the short-query behavior at /apps/files/search?query=xx and trace the search-everywhere entry point from the files app. Check how the two-character query is handled and confirm the intended behavior with maintainers, since the issue leaves the expected result undecided; done should include clear short-query behavior and regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.