Question
I'm wondering how one might design a search that list topics created within a certain time frame, say the past 2 days. I imagine it would require some
SpreadSheetPlugin magic, but even then, I'm not quite sure how to approach it. Any suggestions?
Environment
--
LynnwoodBrown - 07 May 2006
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.
Ah! I tell ya, it ain't easy keeping up with the rapid pace of TWiki innovation! I had overlooked the
TimeInterval feature that was added to search in
DakarRelease. Combining this with a search for version 1.0 of a topic should produce what I'm looking for. I'll post the full solution when I figure it out.
--
LynnwoodBrown - 07 May 2006
OK, here we go: building upon the seach described in
HowToListOnlyNewTopics and using the
date="..." attibute added to
VarSEARCH in
DakarRelease, I came up with this:
%SEARCH{ "META:TOPICINFO.*version=.1\.1[^0-9]" regex="on" date="P2d/$today" nosearch="on" nototal="on" order="modified" reverse="on" header="| *Topic* | *Created By* | *Created On* |" format="| [[$web.$topic][$topic]] | $wikiusername | $date |" limit="15" }%
This will return a list of topics that were created today or yesterday.
--
LynnwoodBrown - 07 May 2006
Thanks for sharing! Possibly tag it, and link to it from a
SupplementalDocument topic?
--
PeterThoeny - 07 May 2006
I think it could better be added to
SearchPatternCookbook!
--
JosMaccabiani - 07 May 2006
Good point!
--
PeterThoeny - 07 May 2006
Thanks so much! I feel kind of silly because I couldn't find the way to use "date" field in searches, but now I can figure out with your example.
--
KimDeal - 29 Nov 2007
Well, I got excited too early. That dates in the example refer only to creation date, right? What I am trying to do is looking for topics with a form field containing dates in a time frame. So does not work for me. Ouch
--
KimDeal - 29 Nov 2007
Kim, have a look at
DBCacheContrib /
DBCachePlugin. This has an easy to grasp query language so that you can write something like
%DBQUERY{"createdate LATER_THAN '2006/01/01' AND createdate EARLIER_THAN '2007/01/01'"
header="| *Topic* | *Date* |$n"
format="| [[$web.$topic][$topic]] | $formatTime(createdate) |"
sort="createdate"
reverse="on"
}%
You can replace
createdate with
MyTimeStamp being a formfield.
--
MichaelDaum - 29 Nov 2007