[KinoSearch] Devel package - cannot access indexed fields
Marvin Humphrey
marvin at rectangular.com
Mon Feb 11 15:38:59 PST 2008
[OK, folks, I'm back in action.]
On Feb 9, 2008, at 6:39 AM, Tamer Rizk wrote:
> After building the InvIndex, I need
> to change the file permissions on _1.cf and segments_2.yaml
> (defaults to
> 600).
This should no longer be necessary as of r2998. Thanks for pointing
it out.
> my $lex = $reader->lexicon( 'summary' ); #silently croaks
That's the interface for the current svn trunk. The current CPAN dev
release has a different interface, and Lexicon isn't even a public
class. You may have become confused by the fact that the docs at <http://www.rectangular.com/kinosearch/docs/devel/
> reflect svn rather than the dev release. I should probably change
that. For now, you might consult search.cpan.org: <http://search.cpan.org/~creamyg/KinoSearch-0.20_051/
>.
Regardless, I'm surprised that the code above would silently croak.
There is no lexicon() method in 0.20_051, so you should see something
like this, even without strict and warnings:
Can't locate object method "lexicon" via package
"KinoSearch::Index::SegReader" at testy.pl line 12.
Try this and tell me what happens:
my $lexicon = $reader->look_up_field('summary');
die "no lexicon" unless $lexicon;
while ($lexicon->next) {
print $lexicon->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?
One possibility is that you are searching for e.g. an unstemmed term
when only the stemmed version exists in the index. A search for
"horse" will turn up empty if the index only contains the stemmed
version "hors".
Also, I'm confused why error messages are not serving to guide you
towards the correct path. When you say that the highlighter "chokes",
what do you see?
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/
More information about the kinosearch
mailing list