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

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

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

-- LynnwoodBrown - 07 May 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.

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. smile

-- 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 frown

-- 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

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2007-11-29 - MichaelDaum
 
  • 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.