Edgewall Software
Modify

Opened 17 years ago

Last modified 9 years ago

#5850 new enhancement

Search Results Per Page Variable

Reported by: jchan@… 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 sid, 17 years ago

A patch would go a ways to making this happen in trunk.

comment:2 by Christian Boos, 17 years ago

Milestone: 0.12
Owner: changed from Jonas Borgström to Christian Boos

comment:3 by osimons, 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 Christian Boos, 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 osimons, 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 reynolds@…, 17 years ago

Cc: reynolds@… added

comment:7 by Christian Boos, 17 years ago

Priority: lownormal
Severity: trivialnormal

On the UI side, this should look similar to what we have now for custom queries.

comment:9 by kb@…, 14 years ago

Cc: kb@… added

comment:10 by Ryan J Ollos, 9 years ago

Owner: Christian Boos removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.