Skip to main content.
home | support | download

Back to List Archive

Re: MetaName grouping follow up

From: Gerald Klaas <gklaas(at)>
Date: Thu Feb 28 2002 - 19:25:41 GMT
Although I think the "perfect fit" for my needs is the config
option during index so that I could do something like:

MetaNameGroup swishdefault swishdefault keywords

I appreciate your forward looking approach of recognizing the
utility of being able to adjust the ranking weights of different
classes.  Although it took me a bit to figure it out, I didn't
have any trouble getting my CGI to use the available search
options to get what I needed.  Initially, I had forgotten to
take into account that the input query string could include
"and" and "or", so I had to make sure that I quoted and paren-ed
the -w option in the swish-search command line.
swish-search -w "keywords=(ozone and nox) or (ozone and nox)" 
-m 20 -b 0 -H 0 -f indexes/i_*.index
---end snip---

IMHO: Because it's so easy to implement this in the CGI, and you've
given code to do so for the included script, I'm hoping you'll
add the above to the "someday maybe..." pile and be back to other
developments, like maybe implementing rank weighting in config
directives instead of config.h  ;-)

Thanks again for all of your help and supporting such a useful
product in the open source license, it's working out great here.
And please ignore anything I just said that disagrees with your
own plans, except the compliment, you're doing amazing work.
(Thanks to David and Jose, too.)

Gerald Klaas

Bill Moseley wrote:
> Hi,
> So the question the other day was how should metaname grouping be designed?
>  And the options were:
> group during indexing:
>    MetaNameGroup group author keywords comment
> which just indexes all words found in author, keyword, and comment also
> under "group" (so those words are indexed twice).
> Or group while searching:
>    -w author,keywords,comment=foo
> Which is really short-hand for
>    -w author=foo or keywords=foo or comment=foo
> Although the first would be easier to implement, I think we need the second
> for this reason: we may want to be able to assign different ranks to the
> individual metanames.
> That syntax of
>    -w author,keywords,comment=foo
> is kind of nasty.  Swish's query parser is not very smart and it's always
> been a pain when I'm in there.  So, it might still be easier to have a
> configuration setting that defines the groups, but that are actually used
> to match multiple metanames while searching.
> Of course, there's always Perl.  To implement this in the swish.cgi script
> would take about two changes:
> In the config file do:
>       groups => {
>           keywords => [qw/ author keywords comment /],
>           all      => [qw/ swishdefault author keywords comment publisher /],
>       }
> then in the code
>       $query = join ' OR ' map { "$_=$query" } @{$groups{$metaname}}
>          if exists $groups{$metaname};
> Now, that's easier.  But might break due to long command lines on Windows.
> I suppose one reasonably easy hack^H^H^H^Hchange might be to allow -w *=foo
> to match any metanames.
> Bill Moseley
Received on Thu Feb 28 19:26:14 2002