Tags:
create new tag
view all tags

Question

Howto search metadata from within a plugin, is there any docs, examples or can someone give a hint. Using same syntax as in %SEARCH{ ... type="query" ......}

I wish to create a simple plugin that takes parameters (this is no problem) and then searches all topics with forms and formfields with the values from the parameters.

I will use this for special purposes so a WebSearch or search in a topic is not the solution.

I see a TWikiFuncDotPm search_InWebContent_searchString but since we can search very elegantly now in the topics with type="query" etc then I want to do similar in a plugin also.

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Debian
Web server: Apache 2.2
Perl version: 5.8
Client OS: Ubuntu, XP
Web Browser: IE, FF
Categories: Forms, Search, Plugins

-- LarsEik - 03 Mar 2008

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.

You can use TWiki::Func::searchInWebContent().

Alternatively, do a VarSEARCH with all the parameters available:

my $text = TWiki::Func::expandCommonVariables( '%SEARCH{ "foo" type="query" ... }', $basetopic, $baseweb );

-- PeterThoeny - 03 Mar 2008

Change status to:
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2008-03-03 - 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.