Tags:
create new tag
view all tags

Question

I have a formatted search working great with one form value, but would realy like it to search on two different form values. I've tried many things but with no luck. Here is my basic, working, formatted search - this is for announcements that are catagorized the same as the topic name:

| Notice: | Submitted by - Last Author: | Last Change - Version: |
%SEARCH{ "[N]oteType.*(td..td|value\=).*%TOPIC%" casesensitive="on" regex="on" nosearch="on" order="modified" reverse="on" format="| [[$topic]]: $summary | $pattern(.*?\s\-\-\s(Main.[a-zA-Z0-9]*).*) - $wikiusername | $date - $rev |"}%

I would also like to narrow the search to another form value of whether the announcement is current or old - here is what my form looks like:

| Name | Type | Size | Values | Tooltip message |

NoteType checkbox 1 EsPolicyNotice, EsGenNotice, EsHelpNotice, EsEdLinkNotice, ParNote, CertNote, ClassifiedNote, AllNote, StaffNote Select what type of notice this is
NoteStatus radio 1 CurrentNotice, OldNotice, Non Select status of notice

So I'm after the CORRECT version of something like this:

| Notice: | Submitted by - Last Author: | Tag | Last Change - Version: |
%SEARCH{ "[N]oteType.*(td..td|value\=).*%TOPIC%; [N]oteStatus.*(td..td|value\=).*CurrentNotice" casesensitive="on" regex="on" nosearch="on" order="modified" reverse="on" format="| [[$topic]]: $summary | $pattern(.*?\s\-\-\s(Main.[a-zA-Z0-9]*).*) - $wikiusername | $date - $rev |"}%

So, is this possible?

  • TWiki version: 01 Feb 2003
  • Perl version:
  • Web server & version:
  • Server OS: Linux Redhat 9
  • Web browser & version:
  • Client OS:

-- KarstynMcCoy - 08 Jul 2003

Answer

I read somewhere that ';' works like AND in WebSearch - maybe you can try it. If it works, let me know - I want search like that too wink

-- PeterMasiar - 11 Jul 2003

I got it! I was soooo close! The above code will work searching on both form entries just by removeing the space after the separating semicolon. So the final working version will look like this:

| Notice: | Submitted by - Last Author: | Tag | Last Change - Version: |
%SEARCH{ "[N]oteType.*(td..td|value\=).*%TOPIC%;[N]oteStatus.*(td..td|value\=).*CurrentNotice" casesensitive="on" regex="on" nosearch="on" order="modified" reverse="on" format="| [[$topic]]: $summary | $pattern(.*?\s\-\-\s(Main.[a-zA-Z0-9]*).*) - $wikiusername | $date - $rev |"}%

  • Note no space after semicolon - %TOPIC%;[N]oteStatus

This does open up lots of possibilities for me on how to better define searches.

-- KarstynMcCoy - 11 Jul 2003

Related topic: SearchUsingMultipleFormValues

-- FranzJosefSilli - 11 Jul 2004

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2004-07-11 - FranzJosefSilli
 
  • 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.