Feature Proposal: Add number of topics to formatted search


The AddFooterParameterToSEARCH allows people to specify a custom footer. WIBNI you can specify the number of topics found?

An extra important motivation is that TWiki introduced this feature in 4.3.0. It would be a hard argument against crossing over if we do not have this feature which is actually a neat feature in many contexts

We need this in next patch release to be competitive. We cannot wait for 1.1.

Description and Documentation

In FormattedSearch, add this to format parameter table:

Number of topics found in current web. This is the current topic count, not the total number of topics
Number of hits if multiple="on". Cumulative across all topics in current web. Identical to $ntopics unless multiple="on"

Add this to footer parameter table:

Number of topics found in current web
Number of hits if multiple="on". Cumulative across all topics in current web. Identical to $ntopics unless multiple="on"




The $ntopics perl variable already exists in Foswiki::Search. A new $nhits needs to be introduced for the number of hits.

The code was already implemented in the other project so it is easy to pick and already tested there. It is very few extra code lines.

-- Contributors: KennethLavrsen - 09 May 2009


I will implement this in the hope I will not have a majority of the community against it.

I am hoping and assuming this is a no-brainer.

-- KennethLavrsen - 09 May 2009

actually, give me an extra week before you do? I have an idea wrt the paging code that i might get time to start - basically, rather than $ntopics which is bad anyway i'm thinking $count($above) and $count($all) where $all would be all results, whereas $above would only be this 'page's.

also, we should not be hard coding 'topic' as SEARCH is going to return any TOM addressable object some time soon - attachments first, but smile (yes, this is all related to the FORMAT{} and ResultSet work

flipside of my request is bug/dumbing down compatibility with tmwiki - dunno, depends on how may people we really think will continue upgrading to them, and using these hamstrung syntax's.

-- SvenDowideit - 13 May 2009

I implemented the proposal the day I wrote it.

I really really do not want to go away from this now. It will break compatibility with TWiki 4.3 and it is more a matter of taste than right vs wrong if it is $ntopics/$nhits or $count something. In fact I cannot understand at all the logic in $all and $above inside a $count. That is a bit more geeky. But I do not mind if you add that ALSO.

I find it is very important that we keep the gate open for people that want to cross over from TWiki 4.3 to Foswiki. As long as our download rate is 1/3 of TWiki we cannot afford to go our own ways yet. So please support that we do not revert what I already did.

-- KennethLavrsen - 24 May 2009
Topic revision: r5 - 06 Dec 2010, GeorgeClark - This page was cached on 06 Aug 2020 - 06:48.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy