lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lance bowler <lanceb...@gmail.com>
Subject Re: [lucy-user] Filter + ClusterSearcher/QueryParser/make_compiler
Date Tue, 20 Dec 2011 05:50:42 GMT
On Tue, Dec 20, 2011 at 3:25 AM, Marvin Humphrey <marvin@rectangular.com> wrote:
> Probably something like this:
>
>    my $cluster_searcher = LucyX::Remote::ClusterSearcher->new(
>        schema => $schema,
>        shards => \@shards,
>    );
>    my $query_parser = Lucy::Search::QueryParser->new(
>        schema => $schema,
>        fields => [qw( title content )],
>    );
>
>    ...
>
>    my $user_query = $query_parser->parse($user_query_string);
>    my $filter = Lucy::Search::TermQuery->new(field => 'foo', term => '1');
>    my $and_query = Lucy::Search::ANDQuery->new(
>        children => [$user_query, $filter],
>    );
>    my $weighted_query = $query->make_compiler(searcher => $cluster_searcher);
>    my $hits = $cluster_searcher->hits(query => $weighted_query);

Cool, thanks!

Mime
View raw message