Tags:
create new tag
view all tags

SID-00674: Automatically create search queries for given list of words

Status: Answered Answered TWiki version: 4.1.2 Perl version: 5.008005
Category: CategorySearch Server OS: RedHat Linux, kernel 2.6.9 Last update: 16 years ago

Hi,
I have variable with list of topic categories:

   * Set TOPIC_CATEGORY = New, Current, Obsolete 

This variable is used to build table:

Name Type Size Values Tooltip message Attributes
Topic category select 1 New, Current, Obsolete Select topic category M

This table is in fact a form, which is used to classify topics.

I would like to have a topic in which all topic categories will be automatically listed as headers. Then for each category, all topics with such category will be listed.

Example:

New

  • Topic A
  • Topic F

Current

  • Topic B
  • Topic D

The only thing I can now build by myself is list of chapters. I'm using LISTJOIN / LISTMAP. But I cannot build search queries.

Can somebody suggest me proper solution?

Defining topic categories using variable is not needed.

-- PiotrSzlazak - 2009-12-16

Discussion and Answer

You should be able to construct a SEARCH within a CALC's LISTMAP.

Test, showing recently updated support questions here in the support forum:

  • Set SUPPORT_STATUS = Asked, Assigned, Answered, Unanswered

Asked

  • SID-02523 Restoring a parent-less web from Trash
  • SID-02522 Regex search: lookaheads
  • SID-02519 TWiki causes an error when accessed through VPN
  • SID-02516 Manage link seems to be incorrectly retrieved
  • SID-02515 Locked down Main web blocks user Watchlist topic creation
  • SID-02513 Safari WebLeftBar not aligned
  • SID-02512 The save script can only be called with POST method.
  • SID-02508 Paypal link on Twiki VM page is broken
  • SID-02505 TOC link doesn't match generated anchor
  • SID-02504 How to select a different store for each web?

Assigned

Answered

Unanswered

View raw text to see how this works.

-- PeterThoeny - 2009-12-17


Hi Peter,
Thanks for your replay. It solved my problem. I was on right way, but I haven't figured out, how to join functionality of LISTJOIN / LISTMAP functions.

But I would ask another question. I would like to implement results counting. If there will be no matching topics, information should be show.

Here is a draft implementation:

%CALC{$SET(count_results, 0)}% 
%SEARCH{"StrangeWordNeverToFind" web="%WEB%" nonoise="on" excludetopic="%TOPIC%" scope="text" format="[[$topic]] $percntCALC{$SETM(count_results, +1 )}$percnt"}%
%CALC{"$IF( $GET(count_results) == 0, Topics *not* found., )"}%
Result:

Topics not found.

When it is used separately, it works. But I have problems with incorporating it with this automatically built searches. In some attempts it is not evaluated, in others - it explodes search queries.

I think it is something wrong with operators escaping. But I cannot figure out how to make it working. Example run:

Asked

  • SID-02523 Restoring a parent-less web from Trash %CALC{}%
  • SID-02522 Regex search: lookaheads %CALC{}%
  • SID-02519 TWiki causes an error when accessed through VPN %CALC{}%
  • SID-02516 Manage link seems to be incorrectly retrieved %CALC{}%
  • SID-02515 Locked down Main web blocks user Watchlist topic creation %CALC{}%
  • SID-02513 Safari WebLeftBar not aligned %CALC{}%
  • SID-02512 The save script can only be called with POST method. %CALC{}%
  • SID-02508 Paypal link on Twiki VM page is broken %CALC{}%
  • SID-02505 TOC link doesn't match generated anchor %CALC{}%
  • SID-02504 How to select a different store for each web? %CALC{}%

Assigned

Answered

  • SID-02480 'rcs too old' even though it's version 5.10.0 %CALC{}%
  • SID-02521 Is MailInContrib Installed On TwikiDotOrg %CALC{}%
  • SID-02520 viewfile timeout %CALC{}%
  • SID-02518 Supported OS for TWiki-6.1.0 %CALC{}%
  • SID-02517 Registration without personal data (like e-mail adress) %CALC{}%
  • SID-02514 New Web RSS feed enabling %CALC{}%
  • SID-02511 A corrupted TWiki page %CALC{}%
  • SID-02382 Set TOPICTITLE on topic creation %CALC{}%
  • SID-00250 Increment formfield %CALC{}%
  • SID-02510 Top level menu and title bar disfigured %CALC{}%

Unanswered

-- PiotrSzlazak - 2009-12-17

Hi again!

I revisited my needs and used build-in functions. Now inline SEARCH is counting results for me. Here is example:

Asked

  • SID-02523 Restoring a parent-less web from Trash
  • SID-02522 Regex search: lookaheads
  • SID-02519 TWiki causes an error when accessed through VPN
  • SID-02516 Manage link seems to be incorrectly retrieved
  • SID-02515 Locked down Main web blocks user Watchlist topic creation
  • SID-02513 Safari WebLeftBar not aligned
  • SID-02512 The save script can only be called with POST method.
  • SID-02508 Paypal link on Twiki VM page is broken
  • SID-02505 TOC link doesn't match generated anchor
  • SID-02504 How to select a different store for each web?
    Number of topics: 10

Assigned
Number of topics: 0

Answered

  • SID-02480 'rcs too old' even though it's version 5.10.0
  • SID-02521 Is MailInContrib Installed On TwikiDotOrg
  • SID-02520 viewfile timeout
  • SID-02518 Supported OS for TWiki-6.1.0
  • SID-02517 Registration without personal data (like e-mail adress)
  • SID-02514 New Web RSS feed enabling
  • SID-02511 A corrupted TWiki page
  • SID-02382 Set TOPICTITLE on topic creation
  • SID-00250 Increment formfield
  • SID-02510 Top level menu and title bar disfigured
    Number of topics: 10

Unanswered

Zeroresult search

Number of topics: 0

-- PiotrSzlazak - 2010-01-14

      Change status to:
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.
SupportForm
Status Answered
Title Automatically create search queries for given list of words
SupportCategory CategorySearch
TWiki version 4.1.2
Server OS RedHat Linux, kernel 2.6.9
Web server Apache 2.0.52
Perl version 5.008005
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2010-01-14 - PiotrSzlazak
 
  • 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.