Tags:
create new tag
view all tags

Feature Proposals » Search With Sort by Multiple Fields

Summary

Current State: Developer: Reason: Date: Concerns By: Bug Tracking: Proposed For:
MergedToCore PeterThoeny None 2013-11-21   TWikibug:Item7391 JerusalemRelease

Edit Form

TopicSummary:
CurrentState:
CommittedDeveloper:
ReasonForDecision:
DateOfCommitment:   Format: YYYY-MM-DD
ConcernRaisedBy:
BugTracking:
OutstandingIssues:
RelatedTopics:
InterestedParties:
ProposedFor:
TWikiContributors:
 

Motivation

In some occasions it is desirable to sort a formatted search by more than one criteria, such as fist by parent, then by formfield Title.

Description and Documentation

Allow sort parameter to have a comma-space delimited list of sort tokens, such as sort="parent, formfield(Title)"

Related, the reverse parameter also supports a comma-space delimited list to have control over reverse sorting per sort token.

Example: sort="formfield(Title), formfield(Due Date)" reverse="off, on"

Examples

1. Simple search format:

%SEARCH{
 "something"
 sort="parent, formfield(Title)"
 nonoise="on"
 format="| [[$topic][$topictitle]] | $summary |"
}%

2. Group topics visually by parent topic:

This can be done by adding an extra table row with parent topic whenever the parent changes.

%SEARCH{
 "something"
 sort="parent, formfield(Title)"
 nonoise="on"
 format="$percntCALCULATE{$IF($EXACT($parent, $GET(parent)), , $SET(parent, $parent)| [[$parent]]: ||$CHAR(10))}$percnt| $percntICON{dot_ur}$percnt [[$topic][$topictitle]] | $summary |"
}%

Impact

Implementation

-- Contributors: Peter Thoeny - 2013-11-21

Discussion

Suggestion by SteveCooper at KampalaReleaseMeeting2013x11x21: Allow reverse option per sort token, not one reverse for all. I updated above spec with this suggestion.

-- Peter Thoeny - 2013-11-22

This feature is now accepted by 7 day feedback period.

I'll implement in SVN trunk and 6.0 release. I think it warrants adding this to the next 6.0 patch release because it is useful, safe and transparent.

-- Peter Thoeny - 2013-11-28

This is now in SVN trunk and 6.0 release.

-- Peter Thoeny - 2013-11-29

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2013-11-29 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.