Tags:
create new tag
, view all tags

SID-00945: Formatted Search, changes to two version back

Status: Answered Answered TWiki version: 4.2.4 Perl version:
Category: CategorySearch Server OS: Last update: 1 year ago

According to the docs for Formatted Search, $changes(n) will give me changes between the latest version and version n.

However, in a search, I really can't guess what n should be. I'm more likely to want to see changes between the latest and two back, or three back, than some explict n.

I tried

%SEARCH{".*"  type="regex" nosearch="on" noheader="on" 
   newline="%BR%" order="modified" limit="20" reverse="on" 
   format="| [[$web.$topic][$topic]] | r $rev | $date -- $wikiname | $changes | $changes($percntCALC{$EVAL($rev - 1)}$percnt) | "}%

But

$changes($percntCALC{$EVAL($rev - 1)}$percnt)

isn't giving me what I want.

I assume there's an "order of evaluation" problem.

Can I do what I want to do? If so, how?

-- VickiBrown - 2010-08-12

Discussion and Answer

The doc is correct, I just checked the code. Whoever designed this spec did not think about usability. Yes, relative version number would be more usable.

CALC will not work here because you need the result of the calculated version number for each search hit, but before $changes is evaluated, which is not possible.

I recommend to post a feature request. Possible spec to remain compatible: Use a negative number to indicate relative version number compared to the current top version. For example, a $changes(-2) shows the difference between the two most recent revisions.

-- PeterThoeny - 2010-08-15

Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider a subscription for support or engage one of the TWiki consultants if you need timely help. We invite you to get involved with the community, it is more likely you get community support if you support the open source project!

-- PeterThoeny - 2010-10-06

Change status to:

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.
SupportForm
Status Answered
Title Formatted Search, changes to two version back
SupportCategory CategorySearch
TWiki version 4.2.4
Server OS

Web server

Perl version

Topic revision: r3 - 2010-10-06 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.