Tags:
create new tag
view all tags

Question

How can I embed the number of results for a search as a column of a table? In my case I am making a code repository and I want to have the following columns:

Algorithm| Number of Submissions

Algorithm is a field on my form that will appear multiple times. Number of Submissions is not stored anywhere - (should be based on number of search results). Any ideas? Thanks in advance.

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- OmarMussa - 10 Aug 2005

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Here is an example of a SEARCH that has an embedded %CALC{$ROW(-1)}% to show a linear numbering of the search hits. The CALC's % sign needs to be escaped with $percnt so that it executes once for each search hit. Look at the raw text to see how.

# Topic Summary
1 WebStatistics Statistics for Support Web Month: Topic Views: Topic Saves: Attachment Uploads: Most Popular Topic Views: Top Contributors for Topic Save...
2 SID-02523 I deleted a web a few years ago (at the user`s request). Let`s call it OldWeb. I did it the recommended way, by moving it to Trash/OldWeb. Now the user wants the web...
3 SID-02522 I am trying to read the content of a single column table with regex search ( type #34;regex #34; multiple #34;on #34; ). The column looks like this: Name...
4 SID-02480 Hello, I #39;m trying to install TWiki 6.1.0 on an Alpine box and have installed rcs from the #39;edge #39; repository. But I #39;m seeing errors that the version...
5 SID-02521 I have a few questions: Is MailInContrib installed (and working) on twiki.org? If so, what is the mailing address? I would like to test it out. I am looking...
6 SID-02520 Recently the server on which I`m running Twiki 6.1.0 was automatically upgraded to AlmaLinux 6.5, perl v5.32.1. Since then, the twiki viewfile scripts has frequent...
7 SID-02519 When I am trying to access my TWiki server running fine on the internal network trough a VPN connection then TWiki throws the error below and does not produce any...
8 SID-02518 Kindly confirm if twiki TWiki 6.1.0 supports #34;Linux 8.8 #34;. Currenlty its running with #34;Linux ver 7.9 #34;. Discussion and Answer I have TWiki 6.1....
9 SID-02517 On registration, a new TWikiUser needs to register with his or hers e mail adress. I`m using separate webs for different collaboration groups, and members of one group...
10 SID-02516 Under the fileattchment section; we have the manage link. We found that this hyperlink is being referred to link as: #60;defaulturlhost #62;/twiki/bin/view instead...

-- PeterThoeny - 13 Aug 2005

I just realize that I misunderstood your question. To get the number of hits and show it in a table cell, you can do a FormattedSearch that increments a spreadsheet variable for each hit. Again, the CALC needs to be escaped.

Example: Search all topics in this web for "Algorithm"

Hits for "Algorithm": 108

If you want to go fancy: You could do a nested search to dynamically build a table of terms with totals. FormattedSearch has the details.

-- PeterThoeny - 13 Aug 2005

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2005-08-13 - 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.