really basic thing that i have somehow forgotten

brad miele <[email protected]> Wed, 25 Oct 2006 17:39:38 -0700 (PDT)
Newsgroups gmane.comp.web.swish-e
Message-ID <[email protected]>
Hi,

I have an index and i am trying to basically dump all of the records that 
don't have a value in the metname subject. This should be all of them.

when i run the following query to test that subject is indeed a 
searchable query, things seem fine:

su-2.05b# ./querytest.pl "waterfall"
QUERY: subject = waterfall
TOT: 691

however, when i try this, which i think should return virtually every 
record, i get nothing:

su-2.05b# ./querytest.pl "not booga"
QUERY: subject = not booga
TOT: 0

querytest just takes $ARGV[0] and passes it to the index via Swish::API, 
since that is what i will ultimately use.

what incredibly basic thing have i overlooked?

#!/usr/local/bin/perl

use strict;
use SWISH::API;

my $q = $ARGV[0];
my $qstringfmt = "subject = %s";
my $query = sprintf($qstringfmt,($q));

print "QUERY: $query\n";

my $idx = "/usr/local/apache/indexing/indexes/master_ipn.index";

    my $swish = SWISH::API->new( $idx );
         if ($swish->Error){ print STDERR "ERR:".$swish->ErrorString; }

    my $search = $swish->New_Search_Object( $query );
         if ($swish->Error){ print STDERR "ERR:".$swish->ErrorString; }

    my $results = $search->Execute;
         if ($swish->Error){ print STDERR "ERR:".$swish->ErrorString; }

    my $hits = $results->Hits;
    print "TOT: ".$hits."\n";

exit;

regards,

Brad
---------------------
Brad Miele
VP Technology
IPNStock.com
866 476 7862 x902
[email protected]