Topic search should use exact match #3815

Closed
opened 2025-11-02 05:26:18 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @davidsvantesson on GitHub (Aug 20, 2019).

Description

Current behavior: Topic search includes all repositories with a topic containing the search string

Expected behavior: When clicking on a topic, you want to search that particular topic, not any topics containing that topic. For example, looking for topic "it" shall not give repositories with topic "git" or "gitea".

I think generic searches could contain any repository with search term in name or part of topic, as today.

Originally created by @davidsvantesson on GitHub (Aug 20, 2019). - Gitea version (or commit ref): 1.10.0+dev-190-g852876a98 - Can you reproduce the bug at https://try.gitea.io: - [x] Yes: https://try.gitea.io/explore/repos?q=it&topic=1 - [ ] No - [ ] Not relevant ## Description _Current behavior:_ Topic search includes all repositories with a topic containing the search string _Expected behavior:_ When clicking on a topic, you want to search that particular topic, not any topics containing that topic. For example, looking for topic "it" shall not give repositories with topic "git" or "gitea". I think generic searches could contain any repository with search term in name or part of topic, as today.
GiteaMirror added the type/enhancement label 2025-11-02 05:26:18 -06:00
Author
Owner

@guillep2k commented on GitHub (Aug 21, 2019):

Currently the search function does not make a distinction between name, description and topic. We could force a search by whole words for all fields, or we could make a distinction for the topic, like in topic:<word>. We could even do both. Is there a preference for this?

@guillep2k commented on GitHub (Aug 21, 2019): Currently the search function does not make a distinction between name, description and topic. We could force a search by whole words for all fields, or we could make a distinction for the topic, like in `topic:<word>`. We could even do both. Is there a preference for this?
Author
Owner

@davidsvantesson commented on GitHub (Aug 21, 2019):

@guillep2k The search function actually doesn't look into description today, something I'm also missing.

In the long term I think it would be a good idea to support filters in repo search, similar that GitHub does for issue search. Search within name and description should probably still be "free text" search.
Something to consider is whether whole words shall always be used for topic search, or only when you specifically search for topic (topic=1). I did a test implementation and noticed a behavior that can potentially be confusing for the user; In the interactive (ajax) search on the dashboard, there can be more results as you type (instead of narrowing down). Although I don't see a problem with that.

@davidsvantesson commented on GitHub (Aug 21, 2019): @guillep2k The search function actually doesn't look into description today, something I'm also missing. In the long term I think it would be a good idea to support filters in repo search, similar that GitHub does for issue search. Search within name and description should probably still be "free text" search. Something to consider is whether whole words shall always be used for topic search, or only when you specifically search for topic (topic=1). I did a test implementation and noticed a behavior that can potentially be confusing for the user; In the interactive (ajax) search on the dashboard, there can be more results as you type (instead of narrowing down). Although I don't see a problem with that.
Author
Owner

@guillep2k commented on GitHub (Aug 22, 2019):

I see, I hadn't thought about the incremental search. It looks like it should be handled differently than the "proper" search.

@guillep2k commented on GitHub (Aug 22, 2019): I see, I hadn't thought about the incremental search. It looks like it should be handled differently than the "proper" search.
Author
Owner

@davidsvantesson commented on GitHub (Sep 10, 2019):

Closing issue as related PR is merged.

@davidsvantesson commented on GitHub (Sep 10, 2019): Closing issue as related PR is merged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3815