[KinoSearch] help with query filter

Mike Barborak barborak at basikgroup.com
Tue Sep 2 13:06:21 PDT 2008


Hello,

I am trying to debug an issue I am having with
KinoSearch::Search::QueryFilter (from KinoSearch version 0.162) and am
hoping I might get a pointer here.

What I am seeing is that when I create an index by the standard calls to
spec_field and add_doc that things work fine. But then if I re-index a
document (done in a different process and without spec_field being called),
my queries begin to fail. If I remove the filter from my query, the results
are as expected and so that's why I'm focusing on the filter.

This is how I spec the filter field in the initial indexing:

$invIndexer->spec_field (
    name       => '__group',
    analyzer   => undef,
    indexed    => 1,
    analyzed   => 0,
    vectorized => 0,
);

What I _think_ is happening is that when I create my index, the filter field
is correctly not being analyzed but that when I do the re-index, it is being
analyzed and this then is causing an issue. The reason I think this is if
the value I use for __group is "events" then I see the issue but if it is
"event" then I do not see the issue.

Something else I saw, if right after I create the index, I dump it, I see
this:

Fields:
  ...
  29: __group [a,i,s]

which is telling me that the field is to be analyzed. Perhaps that's the
issue?

Also, if I diff the dump from a clean index and a dump from after
re-indexing one document, I see entries like this:

> __group:event
>        Doc 0 (2 occurrences)
>        Doc 1 (2 occurrences)

Which seems to be showing the __group field now with an analyzed value. (I
checked my code a few times to make sure I wasn't switching the __group
value between indexings.)

BTW, my filter is created like this:

my $groupQuery  = KinoSearch::Search::TermQuery->new (
        term => KinoSearch::Index::Term->new ( '__group', 'events' )
    );

my $filter = KinoSearch::Search::QueryFilter->new (
        query => $groupQuery
    );

So I'm hoping this rings a bell with anyone in terms of something I'm doing
wrong or what the issue might be. If not then I'll work on developing a
concise test case to hopefully reproduce what I'm seeing.

Thanks for your time,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.rectangular.com/pipermail/kinosearch/attachments/20080902/8f8b18de/attachment.htm


More information about the kinosearch mailing list