SID-02206: Delay a search until search criteria selected
| Status: |
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
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.