Mailing List Archive

QueryParser bug
I've got default_boolop set to 'AND'. I pass QueryParser a query like
"category:(a OR b OR c)" and I get no results. It works if I pass two
categories: "category:(a OR b)" or if I write my query as "category:(a
OR (b OR c))".

How do I see the tree of Query objects that the QueryParser has generated?

--
Edward.

_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
Re: QueryParser bug [ In reply to ]
On Jun 28, 2008, at 1:03 AM, Edward Betts wrote:

> I've got default_boolop set to 'AND'. I pass QueryParser a query like
> "category:(a OR b OR c)" and I get no results. It works if I pass two
> categories: "category:(a OR b)" or if I write my query as "category:(a
> OR (b OR c))".

Thanks for the report. The problem should be fixed by r3553.

> How do I see the tree of Query objects that the QueryParser has
> generated?


Each Query subclass has a custom to_string() method defined. It's
imperfect (and definitely not for round-trip serialization), but
that's what I use to debug,and in this case it worked fine. When a
QueryParser with a default boolop of 'AND' parsed this string:

a OR b OR c

... the output of $query_parser->tree($qstring)->to_string looked like
this...

((a OR b) AND c)

... and it was easy to identify the problematic code in
QueryParser.c. After r3553, to_string yields this, which is correct:

(a OR b OR c)

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


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