Opened 17 years ago
Last modified 10 years ago
#5850 new enhancement
Search Results Per Page Variable
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | search system | Version: | 0.10.3 |
Severity: | normal | Keywords: | |
Cc: | reynolds@…, kb@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Currently when I want to set the results per page from a search, I modify the Search.py "RESULTS_PER_PAGE" variable. This however effects all of my sites. It would be very useful if I could set this in trac.ini. Something like results_per_page = 20 within the [search] section.
Additionally, I would write this into WebAdmin and have it web administer-able.
Attachments (0)
Change History (9)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Milestone: | → 0.12 |
---|---|
Owner: | changed from | to
comment:3 by , 17 years ago
This could well be a session (ie. per user) preference instead of a Trac setting - if the user selects other than default, we remember that for next time. "display 10 - 25 - 50 - 100 results per page" at the bottom of result pages - click on number to make a changed preference, used until other is selected.
comment:4 by , 17 years ago
Yes, something like in #6002 and the proposed session_option.diff.
It would be good to have a helper function to get a setting from the session or the environment, updating the session if needed:
def get_session_option(env, req, section, name, default='', updatekey='update'): """Retrieve user preference for a TracIni setting. Eventually save the session if the user changed his preferences. """
That way, we could conveniently get first the default set by an user, then reverting to the TracIni settings, e.g.
results_per_page = get_session_option(self.env, req, 'search', 'results_per_page', RESULTS_PER_PAGE)
Before defaulting to RESULTS_PER_PAGE, it would take the value from the [search] results_per_page
configuration option if any.
comment:5 by , 17 years ago
#1017 closed as duplicate. It called for including the option of 'all results' or similar, to provide the resultset without pagination.
From best-practice of the larger search-and-list engines, a very common grouping may then be to have options of '10, 25, 50, 100' in addition to 'all'?
comment:6 by , 17 years ago
Cc: | added |
---|
comment:7 by , 17 years ago
Priority: | low → normal |
---|---|
Severity: | trivial → normal |
On the UI side, this should look similar to what we have now for custom queries.
comment:9 by , 14 years ago
Cc: | added |
---|
comment:10 by , 10 years ago
Owner: | removed |
---|
A patch would go a ways to making this happen in trunk.