Tags:
create new tag
view all tags

SID-00971: How do you to reverse an Exclude search?

Status: Answered Answered TWiki version: 4.3.2 Perl version: 5.8.8
Category: CategorySearch Server OS: RHEL3U9 Last update: 15 years ago

I have a search that hits the form field section of a string of topics and lists all hits where the records do NOT include "Closed" in the "Status" field in the form. I'm trying to reverse this for another search and show ONLY the hits from a search with a "Status" of "Closed"... but I can't figure that out.

This is my current working search that populates all records in a table that do not contain the "Status" of "Closed" in a field in a form.

| *Event* | *Name* | *Server Start Date* | *Server Start Time* | *Server End Date* | *Server End Time* | *Server Total Time* |
%SEARCH{ "META\:FORM.*IomDefForm;!META\:FIELD.*Status.*value.*Closed;META\:FIELD.*Data Center.*value.*%URLPARAM{ctr}%" type="regex" excludetopic="IomTemplate" nonoise="on" format="| [[$topic][$percntCALC{$SUBSTITUTE($topic, Iom-,)}$percnt]]%BR%[[$topic][<img src=\"%PUBURLPATH%/%TWIKIWEB%/TWikiDocGraphics/viewtopic.gif\" alt=\"View entry\" title=\"View entry\" width=\"16\" height=\"16\" border=\"0\" />]][[%SCRIPTURL%/edit%SCRIPTSUFFIX%/$web/$topic?t=%SERVERTIME{$hou$min$sec}%][<img src=\"%PUBURLPATH%/%TWIKIWEB%/TWikiDocGraphics/edittopic.gif\" alt=\"Edit entry\" title=\"Edit entry\" width=\"16\" height=\"16\" border=\"0\" />]] | <nop>$formfield(IOMName) | $formfield(ServerStartDate) | $formfield(ServerStartTime) | $formfield(ServerEndDate) | $formfield(ServerEndTime) | $percntCALC{$FORMATTIMEDIFF(minute, 3, $INT($TIMEDIFF($TIME($formfield(ServerStartDate) $formfield(ServerStartTime) GMT), $TIME($formfield(ServerEndDate) $formfield(ServerEndTime) GMT))/60))}$percnt |" }%
Number of entries: %CALC{$ROW(-1)}%

-- JeffreyLovretich - 2010-09-20

Discussion and Answer

That should simply be possible by removing the ! negation from the second search token, e.g.:

"META\:FORM.*IomDefForm;META\:FIELD.*Status.*value.*Closed;META\:FIELD.*Data Center.*value.*%URLPARAM{ctr}%"

For simple queries like this you might want to use a type="query" search instead of a regular expression search. See QuerySearch.

-- PeterThoeny - 2010-09-21

Fantastic and th and thank you! Amazing what a little "!" can do to a search... in the great words of the wise Homer Simpsons...

DOH!

-- JeffreyLovretich - 2010-09-22

      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 How do you to reverse an Exclude search?
SupportCategory CategorySearch
TWiki version 4.3.2
Server OS RHEL3U9
Web server 2.0.46
Perl version 5.8.8
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2010-09-22 - JeffreyLovretich
 
  • 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.