Skip to main content.
home | support | download

Back to List Archive

Re: really basic thing that i have somehow forgotten

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Thu Oct 26 2006 - 14:35:02 GMT
try:
  subject = (not booga)

include the ()

brad miele scribbled on 10/25/06 7:41 PM:
> 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
> bmiele@ipnstock.com

-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
Received on Thu Oct 26 07:35:15 2006