Skip to main content.
home | support | download

Back to List Archive

Re: swish.cgi and metaname search in query.

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Thu Oct 17 2002 - 01:57:35 GMT
At 06:26 PM 10/16/02 -0700, Andrew Smith wrote:
>username=andrew
>
>username=andrew and year=2002 and DNA
>
>In these cases, there is no highlighting and the entire contents of the 
>file is shown (i.e., there is no cutoff to 500 characters).

It should trim a property if not highlighted.  For that matter it should
just highlight words based on metaname.

Without looking, it may be that the query parsing code is failing.  One
thing you might try is using a well formed query -- so instead of 

    username=andrew and year=2002 and DNA

use

    username=(andrew) and year=(2002) and swishdefault=(DNA)

A regular expression has to be used to break the query into groups by
metaname (so the highlighting code knows which words go with each metaname).

The script uses the "Parsed Words" header output from swish.  So you might
print that to stderr.  Also, there's some debugging at the end of
extract_query_match() that you can uncomment to see how it's parsing out
your query.  That also might give you an idea of what's going wrong.


I've been saying for months that that script could use a rewrite.

BTW -- you might also try using the -L limit setting for limiting by years
or a date range.



-- 
Bill Moseley
mailto:moseley@hank.org
Received on Thu Oct 17 02:01:30 2002