Tags:
search1Add my vote for this tag create new tag
view all tags

Question

Hi, i have a Problem in search. I want to search character string exactly like this, with spaces, quotation mark...

title="First Line Manager" value="Lisa"
I wrote search like this:
%SEARCH{ " title="First Line Manager" value="Lisa" " nosearch="on" nosummary="on" regex="on" order="modified" web="Sandbox" topic="*Report"}%

But I can not get correctly result frown .

I also wrote as these formats, but they don't work too:(

%SEARCH{ " title=\"First&nbspLine&nbspManager\"&nbspvalue=\"Lisa\" " nosearch="on" nosummary="on" regex="on" order="modified" web="Sandbox" topic="*Report"}%

%SEARCH{ " title=\"First Line Manager\" value=\"Lisa\" " nosearch="on" nosummary="on" regex="on" order="modified" web="Sandbox" topic="*Report"}%


%SEARCH{ "title=\"First Line Manager\" value=\"Lisa\"" nosearch="on" nosummary="on" regex="on" order="modified" web="Sandbox" topic="*Report"}%

I can see the character string title="First Line Manager" value="Lisa" in back end, in all *Report.txt(I know search method is search value from what we can see from back end ".txt" files)

How can i do that? Appreciated very much... smile

Environment

TWiki version: TWikiRelease04x00x04
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- ShashaLuan - 14 Jul 2006

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.

Unfortunately quoting and escaping quotes in TWiki has always looked somewhat voodoo for me - but I know two workarounds. The first is do a regex search and replace the offending quote by a dot:

%SEARCH{ " title=.First Line Manager. value=.Lisa. " regex="on" }%

Let's do the search right now:


Searched: title=.First Line Manager. value=.Lisa.

Results from Support web retrieved at 17:21 (GMT)

Question Hi, i have a Problem in search. I want to search character string exactly like this, with spaces, quotation mark... title `First Line Manager` value `Lisa...
Number of topics: 1

You may, per accident, find a topic containing the string title=1First Line Manager2 value=3Lisa4 - but I'd guess such strings are not encountered frequently....

Another workaround is to use single quotes ' in your topics. A string like title='First Line Manager' value='Lisa' should make absolutely no problems in a search.

-- HaraldJoerg - 14 Jul 2006

Thanks very much for your help :), but the character string format "title="First Line Manager" value="Lisa" " is original from the form(raw text of the form), so i cannot change as " "title=.First Line Manager. value=.Lisa. " " or "title=1First Line Manager2 value=3Lisa4" frown

-- ShashaLuan - 15 Jul 2006

You need to do a regex search as pointed out by Harald. I usually search this to catch just the meta data: "META:FIELD.*First Line Manager.*value.Lisa"=. To access the form field value in a FormattedSearch you can simply do a $formfield(First Line Manager) in your format parameter of SEARCH.

-- PeterThoeny - 15 Jul 2006

thanks very much, it works:)

-- ShashaLuan - 15 Jul 2006

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