Tags:
create new tag
view all tags

SID-02206: Delay a search until search criteria selected

Status: Answered Answered TWiki version: 6.0.0 Perl version:
Category: CategorySearch Server OS: Last update: 9 years ago

I have a twiki topic that is performing a search of many forms. The search criteria is selected using pull down selections. When the topic search page is first rendered it performs the search automatically before the selection have been made. There are a lot of forms being searched so this takes a while to return the results. I would like to delay the automatic search until the selections have been made.

-- TWiki Guest - 2016-06-02

Discussion and Answer

There are several ways to do that, such as conditional search. The easiest way to disable an embedded search is to add a search criteria that runs fast and returns zero hits if no URL parameter is present, such as by specifying a topic name that does not exist. Untested example, assuming you have a URL parameter called search:

%SEARCH{
  "..."
  topic="%IF{
    "defined 'search'"
    else="do-zero-hits"
  }%"
  ...
}%

-- Peter Thoeny - 2016-06-04

      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 Delay a search until search criteria selected
SupportCategory CategorySearch
TWiki version 6.0.0
Server OS

Web server

Perl version

Browser & version

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2016-06-04 - 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.