[KinoSearch] With heed_colons=1, search term 'url:foo.bar' causes crash

Marvin Humphrey marvin at rectangular.com
Wed Jun 6 12:36:27 PDT 2007


On Jun 6, 2007, at 9:08 AM, Henka wrote:

> Changing the default field search behavior to ON (ie, heed_colons    
> => 1),
> and searching the USCons/sample for 'url:foo.bar' causes a crash:
>
> Can't call method "get_doc_freq" on an undefined value at
> /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/KinoSearch/ 
> Search/PhraseQuery.pm
> line 151.
>
> It seems to happen with most [[:punct:]] chars (ie, url:foo;bar
> url:foo,bar url:foo:bar url:foo-bar etc all fail).
>
> Non- punctuation delimited strings are OK (eg, url:amendment).

Thank you for the report.  This should be fixed as of repository  
revision 2462.

For those that hadn't seen the change going past, the  
'field:term_text' syntax is now off by default.  Also,  
KinoSearch::QueryParser::QueryParser has moved to  
KinoSearch::QueryParser.  The old class structure was parallel to  
Lucene, but we veered off that path a looooong time ago.

By the way, Henry, this happens to behave correctly...

    my $qparser = KinoSearch::QueryParser->new(
        heed_colons => 1,
        schema      => MySchema->new,
    );

... but the official documentation says you must do this:

    my $qparser = KinoSearch::QueryParser->new(
        schema => MySchema->new,
    );
    $qparser->set_heed_colons(1);

I'm trying to avoid piling everything into a single constructor  
method.  Also, if the class ever gets ported to C (admittedly  
unlikely for QueryParser, but has happened with a lot of other  
classes), those extra params will start triggering exceptions.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/





More information about the kinosearch mailing list