Tags:
create new tag
view all tags

Question

I have a Formatted Search that looks for topics based on their META:TOPICINFO author

%SEARCH{"META:TOPICINFO.*?author\=.*?%URLPARAM{"qBy"}%" web="%INCLUDINGWEB%" regex="on" ...}%

(See Support.SearchFormStartUpEmpty for additional code and details.)

Unfortunately, this is only searching across the "last modified by" authors. If possible, I want to search in both "last modified by" and "created by"

Is this possible? Easy?

Environment

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

-- VickiBrown - 14 Jul 2007

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.

yes, you can easily use FormattedSearch.


| *topic* | *web* | *date* | *created by* | *last modified by* |
%SEARCH{".*" web="%WEB%" type="regex" limit="10 "nonoise="on" format="| $web.$topic | $web | $date | $createwikiusername | $wikiusername |" }%

-- CarloSchulz - 17 Jul 2007

No, you misunderstand. I know how to do a generalized search and SEE the authors. I want to Search BY author. I want to search through the metadata for both the created by and lasty modified by fields.

Something like (pseudocode): if ( ($createdby =~ /AUTHOR/) || ($modifiedby =~ /AUTHOR/) ) print;

-- VickiBrown - 19 Jul 2007

Try something like this replacing Main.DaffyDuck as required; could make it generic using the WIKINAME variable.

%SEARCH{".*" scope="topic" nonoise="on" format="$percntIF{\"'$createwikiusername'='Main.DaffyDuck' OR '$wikiusername'='Main.DaffyDuck'\" then=\"   * $topic\" else=\"\"}$percnt" }%

-- DewayneVanHoozer - 20 Jul 2007

It is curretnly not possible to search by first author. Dewayne describes a good workaround, I have not thought of. Basically search on all, and in the format throw away the hits you do not want. Suggestion: In the else part, ouput a nop tag so that the "discard hit" line gets removed completely (instead of introducing an empty line), e.g. else=\"<nop>\"

-- PeterThoeny - 21 Jul 2007

I'm not finding %IF. I'm finding %CALC{$IF and %IFDEFINED... I tried to build something with SpreadSheet plugin but $OR doesn't evaluate conditionals, and this is text not numbers and... sigh.

-- VickiBrown - 22 Jul 2007

TWikiVariables

-- CarloSchulz - 22 Jul 2007

Thanks Carlo, I did find that eventually and have been trying various tweaks to the syntax. The real problem was, it didn't work. :-(

I posted a query at TWiki.IfStatements and played with the quoting until I got everything working.

-- VickiBrown - 22 Jul 2007

Change status to:
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2007-07-22 - VickiBrown
 
  • 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.