Tags:
create new tag
, view all tags

Question

I am trying to use the $AND variable inside a search statement but cannot get it to properly retrieve the results. The search works when I use one variable but I do not know how/where to add the &AND statement to search on the second variable and the first variable and return the results. Here is what I am using(with hardcoded conditional):

***Click Edit below to view the query statement***
%SEARCH{ "[R]esourceContinent.*(value\=).*Africa"  type="regex" web="Reporters", -TWiki, -Main, -Trash"
 scope="text" casesensitive="off" regex="on" nonoise="on" nototal="on" nosearch="on" 
format="$formfield(ResourceName)" 
<div class='WebsBodyLink'><a href='%SCRIPTURLPATH{view}%/$web/WebHome'> 
<em></em></a></div>, <nop>)\"}%

But when I try to add a second variable to search with it returns no results although it should return 1.

Thanks in advance!

Environment

TWiki version: TWikiRelease04x01x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server: Apache
Perl version:  
Client OS: Win XP Pro SP2
Web Browser: IC 6.0
Categories: Search

-- ZachGrieshop - 16 Oct 2007

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Did you try ";" as the AND separator? Taking your example:

%SEARCH{
  "FORM\:FIELD.*[R]esourceContinent.*value\=.*Africa;FORM\:FIELD.*OtherFieldvalue\=.*Anything"
  type="regex"
  web="Reporters"
  scope="text"
  regex="on"
  nonoise="on"
  format="$formfield(ResourceName)"
}%

See VarSEARCH and FormattedSearch.

-- PeterThoeny - 16 Oct 2007

 
Change status to:
Topic revision: r3 - 2007-11-01 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.