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
--
VickiBrown - 14 Jul 2007
Answer
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