Skip to main content.
home | support | download

Back to List Archive

Re: Filtering terms with swish.cgi

From: <moseley(at)not-real.hank.org>
Date: Tue Oct 14 2003 - 14:46:10 GMT
On Mon, Oct 13, 2003 at 07:16:47PM -0700, Dave Moreau wrote:

> > >Yes, so look at that spot I pointed out.  You would do someting like:
> > >
> > >   my $verses = $q->param('verses');
> > >   if ( $verses ) {
> > >       my $verses_key = convert_to_verses_id( $verses );
> > >       $query .= " and verse=($verses_key)" if $verses_key;
> > >   }
> > >

> I tried something like this:
> 
> my $query = $q->param('query') || '';
> my $verses = $q->param('verses') || '';
> $query .= ' ' . $verses;

Where did you add that?  If your "verses" is a separate metaname you 
will need to use that meta name like in my example above.

There's a function called build_query().  I assume that's where you are 
placing that?  If you are placing that too early in the build_query() 
function then later it's going to get a metaname appended.

If you are not using a metaname then what you are doing should work, 
although I thought you said $q->param('verses') is before it's 
converted into your verses "keyword" id.

I don't have enough information to really help.  But I can offer these 
suggestions:

1) make sure you can indeed search your verses keywords from the command 
line (without using swish.cgi).

2) look through the build_query() subroutine and make sure you 
understand (mostly) what it's doing.  Add in "print STDERR $query"
at various places to see what's actually getting set.

3) Turn on debugging or add code to print the command line used to run 
swish-e and make sure it's what you tried in step 1.


-- 
Bill Moseley
moseley@hank.org
Received on Tue Oct 14 14:46:13 2003