Jason McIntosh wrote on 1/9/12 4:37 PM: > On Jan 9, 2012, at 4:07 PM, Peter Karman wrote: > >> I use Search::Query::Dialect::Lucy[0] to do this, in conjunction with this >> kind of query mangling: > > This looks like a promising solution, but it's unclear where one configures > Search::Query::Dialect::Lucy to use the prepared Lucy schema object?
There's currently no support for that in SQDL. I do have support for that in SWISH::Prog::Lucy::Searcher -- check out the init() method source for example. I welcome a patch to SQDL to add Lucy::Plan::Schema support. I suggest a static class method that returns a data structure suitable for passing into the 'fields' param to the Parser constructor. Something like: my $fields = Search::Query::Dialect::Lucy->extract_schema_fields( $schema ); my $parser = Search::Query::Parser->new( fields => $fields ); > > I have your suggested solution partially working, but since the Search::Query > parser appears to have no access to the Lucy schema object, it doesn't know > what > fields are available to search, and so all non-field-specific queries fail. > (Setting its default_field option to "", per the Search::Query::Parser docs, > blows up when it later tries to use "" as an array reference.) that "" error does indeed sound like a bug. If you could turn that into a failing test case and open an RT ticket, I would be forever grateful. If you do git, you can fork it from here https://github.com/karpet/search-query-perl. > > (Please let me know if discussion pertaining to Search::Query should go > off-list...) > I'm ok with the current thread; I'll let others speak up if they find this too off-topic. -- Peter Karman . http://peknet.com/ . [email protected]
