Skip to content

Incomplete issue search results in repository with many issues #24662

Closed
@brechtvl

Description

@brechtvl

Description

There multiple ways to reproduce this, but one way:

  • Create 50 issues with same title
  • Create 1 pull request with the same title as the issues
  • Searching for the title will return either 0 results in pull requests search, or only 49 results in issue search

Another way:

  • Create 60 issues with same title
  • Apply one label to 30 of them, and another label to the other 30
  • Search for the title, filter by one of the labels, and it will return less than 30 results

The reason behind this is that that indexers will index the title, contents and comments and return up to 50 search results based on that. Filtering by issue or PR, open or closed, labels, author, .. happens afterwards. Note that pagination as in #22704 does not solve this problem.

The solution could be to make all indexers filter by and index all these issue fields. That would require adding quite a bit of code to all indexers though, every filtering option would need to be implemented in every indexer.

Alternative solutions with worse performance would be to get an unlimited number of results from the indexers, or compute a list of filter matching issue IDs to give to the indexers.

Gitea Version

60e7963 (main)

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Own build, using meilisearch. But it should happen anywhere, with any indexer.

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions