[KinoSearch] basic search example - cant create object

Marvin Humphrey marvin at rectangular.com
Thu Jan 25 22:31:53 PST 2007




On Jan 25, 2007, at 9:29 PM, Klaus Gruen wrote:

>  I added that to the top of the example code thats posted on the  
> web and in my email below and get this:

I wish I could say I see something, but it looks entirely normal.   
That error makes no sense to me.

In the relevant section of code, BooleanQuery is iterating over its  
subclauses, extracting their Query objects, and calling a method on  
them. (The method happens to be create_weight(), but that doesn't  
matter.)  In this case, there should be two subclauses, one for 'foo'  
and one for 'bar'.  Each should have a TermQuery in it.

Either one of those TermQuery objects has mysteriously transformed  
into an undef, or there's an extra mystery clause with an undef.   
I've never seen either of those things happen.  If the query string  
were something esoteric, I'd suspect a bug in QueryParser, but 'foo  
bar' shouldn't be misbehaving.

The strange thing is that if your install was borked, I'd expect  
stuff to fail long before we get to that point.  And we haven't even  
gotten into the C code -- Searcher, QueryParser, and all the Query  
classes are pure Perl in 0.14.

I'd be surprised if KinoSearch can pass its test suite if something  
like this is going on.  Grab a copy of 0.14 from <http:// 
www.rectangular.com/downloads/KinoSearch-0.14.tar.gz>, decompress it,  
cd into the t/ directory and start running test files:

    perl 501-termquery.t

... and so on.  Do they work?

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



_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch




More information about the kinosearch mailing list