Mailing List Archive

Debugging a Query..
what's the best way to see what a query is getting analyzed to..

Seems like I used to be able to call Dumper on a $query object and it
would show the terms/values and how it was analyzed.
On Trunk this seems to no longer work..
So how do I Debug what I'm about to send to $searcher->search

Thanks,
-Dan

_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
Re: Debugging a Query.. [ In reply to ]
On Sep 7, 2008, at 3:49 PM, Dan wrote:

> what's the best way to see what a query is getting analyzed to..

Use $query->to_string().

> Seems like I used to be able to call Dumper on a $query object and it
> would show the terms/values and how it was analyzed.

Yes, that's right. In trunk, all KS classes are now implemented as C
structs. (There are only about 500 lines of Perl left in the KS module
code, all of it in KinoSearch.pm.) For classes that need to be
serialized (Query and its subclasses, Doc, etc...) I've gotten them
working with Storable using Storable's hooks. Unfortunately,
Data::Dumper provides no such hooks.

For the future, I've thought about implementing a dump() method on
KinoSearch::Obj (the base class for all KinoSearch objects) which
defaults to calling to_string(), but might be overridden to provide
more detail. Then we could set up Data::Dump::Streamer hooks which
call dump() and suggest DDS as an alternative to Data::Dumper.

Setting up DDS hooks would be pretty easy. What would be a little
more work is setting things up so that we get polished output with
proper indenting and all that. Let me know if to_string() doesn't
give you enough detail.

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




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