There has been a need for SEARCH functionality that just returns the number of hits, without any text or the actual search result, just the number. This is useful for feeding into the
SpreadSheetPlugin or the
GaugePlugin. The following solutions have been devised:
- DaveAlsup has provided the QuickSearchPlugin, which has the "totalonly" parameter. However, this plugin does not incorporate the newest SEARCH feature (AND search using semicolon(;)).
- Locally hacking the search.tmpl file, removing the "Number of topics: " string. A formatted SEARCH using a format string of " " (note the space) will do it. This is ugly.
- Enhancing the SEARCH variable with something alike QUICKSEARCH's "totalonly"
Maybe the last option is the way to go?
plaintotal="on" could remove the text in front of the actual number, without conflicting with other SEARCH parameters.
See also:
QuickSearchDev,
QuickSearchPlugin,
QuickSearchPluginDev,
SearchEnhancmentsRFC
--
StefanSteuerwald - 05 Jun 2002
Just for the sake of completeness, another option is to switch the TWiki search to use a search engine (like Namazu) instead of the current grep based search before making any significant changes in functionality -- see
SearchEngineVsGrepSearch
--
RandyKramer - 05 Jun 2002
I'm not sure about when the SEARCH results get rendered in relation to when the various callbacks in the plugins are called, but perhaps if all of the SEARCH is rendered before the plugins execute, then you could just have a one-liner plugin that could take out the text from the standard search total and just leave the number? Even if this doesn't work can somebody let me know what is the exact order of functions called during the whole page rendering process?
--
DavidSachitano - 11 Jul 2002