incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <>
Subject Re: Bus error with QueryParser and Perl class
Date Mon, 15 Jun 2009 03:25:45 GMT
On Sun, Jun 14, 2009 at 06:42:20PM -0700, wrote:

> > FYI, I just today changed QueryParser's factory method names from e.g.
> > "make_termquery" to "make_term_query".  (: Seems like the right move since
> > you'd accidentally used the new spelling in your post. :) You'll need to
> > change those in your QueryParser subclasses.
> Strangely, make_termquery still works (rev. 4798) but make_term_query  
> causes a bus error. Having both present also causes the crash. (Try  
> the same script with that change.)

I presume that this is without applying the patch to RegexpTermQuery?  If so,
then I get the behavior you describe.  

But "make_termquery still works" isn't quite right.  What's happening is that
you've installed a method that KS doesn't care about -- make_termquery() --
but haven't overridden the one that it *does* care about, make_term_query().
So the stock make_term_query() is returning a plain old TermQuery which
compiles down to a TermScorer.  TermScorer doesn't have the segfaulting Tally
issue, so the script finishes cleanly -- but that's just hiding the problem.

Unfortunately, unlike most of the changes that go into KS, this one induces
silent failure.  It's possible to make it catastrophic failure, by installing
stub methods into QueryParser, detecting if they've been overridden and
throwing an error, but for esoteric reasons that's a lot of work... and I
think that the number of people who are overriding QueryParser's factory
methods is small at this point, since they're only public in svn trunk.

> > Also, Scorer has been replaced by Matcher and Compiler_Make_Scorer()  has
> > been replaced by Compiler_Make_Matcher().  I'd put some compatibility
> > stubs into KS trunk specifically so that the WildCardQuery 0.03 distro
> > would still  pass its tests, but it turns out that you're going to need to
> > release a new  version anyway.  Diff below.
> Now you’re writing my code for me! That’s nice. Thank you. :-)

There may be another patch coming.  I'm not sure what to do about tally(), but
today I'm leaning towards junking it and going back to score().  

I'd wanted to run the tally() experiment in KS so that we'd know how it worked
for Lucy, but it's just that -- an experiment -- and it won't pay off until I
write some code which exploits it.  (I doubt that anyone else would take
advantage of it until I demonstrate its usefulness.)  There are a lot of other
experiments for me to run, though, and score() is a known working design.

Marvin Humphrey

View raw message