Re: [htdig] [Q]: MORE SPECIFICS: How to set it up to search by date?

Gilles Detillieux (
Tue, 23 Feb 1999 17:04:59 -0600 (CST)

According to mike grommet:
> Just thought I would go into a bit more detail here.
> The archives themselves are going to be contained in a MYSQL database, which
> of course is a no-no for
> keyword searching... but I have an idea:
> I will have a script, actually a cgi that will view an archived story.
> I then can basically use htdig to dig the URL of the cgi, essentially
> indexing
> the archived article as returned by that cgi. I will basically have a
> nightly
> update to parse the articles as they are moved into the archives. No big
> deal here.
> When someone searches, the URL given by htdig will call the same cgi that
> was called to index it.
> The database itself will contain the original date of the article.
> So, I need to be able to pass in the date of the document from the database,
> when it indexes
> (since its not actually indexing a real document, just the output of a url)

I haven't actually tried this, but if your CGI script outputs a
"Last-Modified: " header, with a properly formatted date, htdig should
pick that up as the modification date and time for the "file". It would
show that date/time in the builtin-long format search results, and would
sort on that time if you use the time sort option.

> I notice that htdig recognizes a META TAG of htdig-notification-date, and I
> know I could embed
> the meta tag in the output of the cgi but it seems the
> htdig-notification-date tag is only to be used
> to have it alert an author of an outdate document...

This is used by htnotify, but currently not used at all by htsearch.
It's probably not what you want.

> What I want to do seems reasonable.
> Also, how would I specify a date range to search by? I've been looking for
> an example, but
> havent found one yet....

I don't think you can do it right now, without modifying htsearch.
I suspect Geoff thought you were asking about the sort by date feature,
which was added to 3.1.0 & 3.1.1. That's not quite the same as what
you're asking, but I guess it's a start. You'd have to add input
options to htsearch to specify the start and end dates, and code to
reject matches falling out of that range.

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930
To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the SUBJECT of the message.

This archive was generated by hypermail 2.0b3 on Fri Feb 26 1999 - 14:34:12 PST