Skip to main content.
home | support | download

Back to List Archive

really basic thing that i have somehow forgotten

From: brad miele <bmiele(at)>
Date: Thu Oct 26 2006 - 00:43:03 GMT

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# ./ "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# ./ "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?


use strict;

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";



Brad Miele
VP Technology
866 476 7862 x902
Received on Wed Oct 25 17:43:22 2006