[KinoSearch] Devel package - cannot access indexed fields
Tamer Rizk
trizk at inficron.com
Sat Feb 9 06:39:06 PST 2008
Hi,
I recently installed and tested KinoSearch-0.162. Some features that I
would like to use such as the RangeFilter are implemented in the devel
version, so I upgraded to KinoSearch-0.20_051 on RH 2.6.9-34 i386 with
all build tests passing. I dont mind using the dev package, however I am
having trouble getting basic functionality to work such as reading
fields from the InvIndex. My configuration is very close to that
KinoSearch::Docs::Tutorial::BeyondSimple with the exception that I am
defining %conf directly in both the indexer and search scripts (instead
of reading it from a single file). After building the InvIndex, I need
to change the file permissions on _1.cf and segments_2.yaml (defaults to
600). In search.pl I have something like:
use lib '/path/to/KIndexer.pm/';
use KIndexer;
use KinoSearch::Searcher;
use KinoSearch::QueryParser;
use KinoSearch::Highlight::Highlighter;
my $searcher = KinoSearch::Searcher->new( invindex=>KIndexer->read(
$conf{'invindexpath'} ), );
my $reader = $searcher->get_reader;
print 'docs: '. $reader->max_doc; #about 5k
print ' accessible: '.$reader->num_docs; #about 5k
my $lex = $reader->lexicon( 'summary' ); #silently croaks
$lex->next;
print "\nterm: " .$lex->get_term->get_text;
'summary', and five other fields are defined as text in package KIndexer
within our %fields. I think default mode is index and vectorize. However
, searching (even with a simple term, no query parser) yields no hits,
the highlighter chokes (when implemented according to devel docs), and
fields seem to be undefined. Any ideas?
Thanks,
Tamer
More information about the kinosearch
mailing list