A similar function already exists in the API (libswish-e) but not in the swish-e
command line tool. Look at SetSearchLimit() in the API docs and the proplimit.c
src file.
Example (using my swishdebug script that uses the perl API):
karpet@cartermac 43% cat date*html
<html>
<head>
<meta name="date" content="17760704" />
</head>
<body>
foo bar
</body>
</html>
<html>
<head>
<meta name="date" content="20050704" />
</head>
<body>
foo bar
</body>
</html>
karpet@cartermac 44% cat date_c
MetaNames date
PropertyNames date
karpet@cartermac 45% swish-e -c date_c -i date*html -v 3
..
Checking file "date1.html"...
date1.html - Using DEFAULT (HTML2) parser - (3 words)
Indexing "date2.html"
Checking file "date2.html"...
date2.html - Using DEFAULT (HTML2) parser - (3 words)
...
karpet@cartermac 46% swishdebug foo
Found 2 hits
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
date »20050704«
swishdbfile »index.swish-e«
swishdocpath »date2.html«
swishdocsize »93«
swishfilenum »2«
swishlastmodified »1131250346«
swishrank »1000«
swishreccount »1«
swishtitle »«
fuzzy: foo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
date »17760704«
swishdbfile »index.swish-e«
swishdocpath »date1.html«
swishdocsize »93«
swishfilenum »1«
swishlastmodified »1131250336«
swishrank »1000«
swishreccount »2«
swishtitle »«
karpet@cartermac 47% swishdebug -p date -h '17770101' -l '17760101' foo
Found 1 hits
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
date »17760704«
swishdbfile »index.swish-e«
swishdocpath »date1.html«
swishdocsize »93«
swishfilenum »1«
swishlastmodified »1131250336«
swishrank »1000«
swishreccount »1«
swishtitle »«
William M Conlon scribbled on 11/5/05 5:53 PM:
> Here's a possible wish list item that I don't yet see on the list of
> future enhancements: Collation (ordering) of meta tags so one could
> limit a search by
>
> metaname < quantity
>
> in addition to string comparison (metaname = word)
>
> For example, dates stored as metatags (yyyymmdd):
>
> swish-e -w "date < 17760704"
>
> Another is a collection I have where individual documents have access
> attributes (say ordered 0,1,2,...), where higher means more access.
> I spider into a common index, with each @url entry starting at a
> page that lists all documents (to which swishe has access),
> recording the access level in the access metatag. Although access to
> the document itself is separately restricted by an application, I
> want to avoid information leakage in the description property, so:
>
> swish-e -w "access = (0 or 1 or 2)" for someone with access level 2
>
> But with a collation order, I could also use swish-e -w "access <
> $user_access_level"
>
> Admittedly this is much less compelling than date sequences.
>
>
>
> Bill
--
Peter Karman . http://peknet.com/ . peter(at)not-real.peknet.com
Received on Sat Nov 5 20:22:21 2005