Skip to main content.
home | support | download

Back to List Archive

Re: Request for new feature

From: Bill Moseley <moseley(at)>
Date: Tue Apr 03 2001 - 13:20:04 GMT
At 04:05 AM 04/03/01 -0700, Stefan Bergstrand wrote:
>There is one thing that I would love to see added to swish-e. It is
>the ability to pass a date when indexing, and then to be able to pass
>two dates, "before" and "after", when searching and limiting the
>results to only have dates between the given dates.

This has been an often-discussed topic lately.  I think to implement it
correctly would require redesign of the index.  But, I also would think
that there might be a hack where the results could be limited by date after
swish finds all the results, but before printing them.  If you come up with
such a hack, please let us know.

>My first thought was to store the date as returned by the OS-function
>"stat()", but it would be better to be able to specify it at
>indexing-time since you might want to index a group of files as one
>"entity", eg. an article on a news-website, where the date should have
>the meaning "the date when the article was published".

You have a few options, currently.  First, swish does now (in dev version)
store the last modified date for files read with the fs method (not
currently with http method).  If you use the "prog" method you can set the
date anything you want while indexing.

Also, there's nothing to stop you from defining a date or dates with a
property.  So you can pick what date to save in the index.

You can't currently select a date range, but if you want all records with a
date earlier or later than a given date, then you can just sort the results
by the date[1] and just read the results until the date is before/after
your limit date.  The included Perl interface to the swish C library might
make it easier to filter the results.

[1] currently, all properties are sorted as strings, so this will be a 1BB
(One Billion Bug) this September.

Bill Moseley
Received on Tue Apr 3 13:25:36 2001