cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Feature Proposal: Document two important parameters for Foswiki::Func::query

Motivation

Make sure that the option names do not change in future

Description and Documentation

In connection with MultiSearchPlugin I found that the available options for Foswiki::Func::query was very limited and I missed options related to which topics to search. It turns out that they are fully and well supported. Just not documented.

Examples

Here is an example code where the two options make sense

my $matches = Foswiki::Func::query( "$multiSearchStrings[$i]", undef,
                                         { web => $paramWeb,
                                           casesensitive => 0,
                                           files_without_match => 0,
                                           type => 'query',
                                           includeTopics => $includeTopics, #undocumented
                                           excludeTopics => $excludeTopics, #undocumented
                                         }
                                      );

Impact

There is no code impact. This already works in 1.1 and 2.0. It is just not documented in the documenation. Several options are listed. I suggest adding includeTopics and excludeTopics as they are vital to having a good performance when calling the function in a plugin. The alternative is that the plugin has to create a list making an additional search OR adding the condition to the query. Both ways are much slower.

%WHATDOESITAFFECT%
edit

Implementation

I will naturally add the two lines of documentation to the Foswiki/Func.pm file. It is just a matter of specifying includeTopics and excludeTopics.

-- Contributors: KennethLavrsen - 19 Aug 2015

Discussion

 
Topic revision: r4 - 09 Sep 2015, GeorgeClark - This page was cached on 23 Jun 2018 - 00:12.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy