Opened 11 years ago
Last modified 10 years ago
#11428 new enhancement
Limit search realm when using quick search bar
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | search system | Version: | 1.0.1 |
Severity: | normal | Keywords: | |
Cc: | ethan.jucovy@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Problem
I frequently find myself using the quick search bar at the top of the page to search for things in a particular realm (wiki, milestones, etc). My typical workflow looks like this:
- Type search terms in quick search bar, press enter
- Once the results page loads, untick the boxes for changesets, tickets, and milestones
- Click 'Search'
- Desired search page finally loads
Doing a realm-limited search actually requires two searches, which can take a long time on systems that have a lot of content or are behind a slow connection. It would be helpful if there was a way to limit a search to a specific realm from the quick search bar. This would reduce the above process to one step and reduce the number of page loads needed. It would also reduce the number of times the user has to switch between using the mouse and the keyboard, which is something that slows many users down (especially those of us stuck on laptops with trackpads).
Current Workarounds
You can do a realm-limited search like this by clicking the "Search" button on the top toolbar and using that search form instead of the quick search bar. This approach is sub-optimal because it still requires an unnecessary page load. It also doesn't handle some handy use cases like dragging and dropping text from a page into the quick search bar.
You can also do this by entering a complete Trac search string in the quick search bar (like search:?q=search+terms&wiki=on
). The syntax required for this method is too arcane for most users to use on a regular basis.
Proposed Solution
The quick search bar can be enhanced to recognize a specially-formatted realm name as the first argument, and then limit the results of the search to that realm. For example, something like this could be used to perform a quick search that only covers the wiki:
[wiki] search terms realm:wiki search terms wiki: search terms
I'm not sure what the best syntax for this sort of thing would be, but you get the idea. You could even extend this to support multiple or inverted selections, like:
# Limit search to wiki and commit messages realm:wiki,changesets search terms # Search everything *except* the wiki realm:-wiki search terms
Based on my limited understanding of the Trac code, it looks like this would require the process_request
method of class SearchModule
to update the local variable filters
when one of these realm-limiting tags is present and then delete that portion of the search string from query
.
Attachments (0)
Change History (2)
comment:1 by , 11 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
Milestone: | → undecided |
---|