NAME

Lucy::Search::ORQuery - Union multiple result sets.

SYNOPSIS

my $foo_or_bar_query = Lucy::Search::ORQuery->new(
    children => [ $foo_query, $bar_query ],
);
my $hits = $searcher->hits( query => $foo_or_bar_query );
...

DESCRIPTION

ORQuery is a composite Query which matches when any of its children match, so its result set is the union of their result sets. Matching documents recieve a summed score from all matching child Queries.

CONSTRUCTORS

new

my $foo_or_bar_query = Lucy::Search::ORQuery->new(
    children => [ $foo_query, $bar_query ],
);

Create a new ORQuery.

  • children - An array of child Queries.

METHODS

make_compiler

my $compiler = $or_query->make_compiler(
    searcher    => $searcher,     # required
    boost       => $boost,        # required
    subordinate => $subordinate,  # default: false
);

Abstract factory method returning a Compiler derived from this Query.

  • searcher - A Searcher.

  • boost - A scoring multiplier.

  • subordinate - Indicates whether the Query is a subquery (as opposed to a top-level query). If false, the implementation must invoke normalize() on the newly minted Compiler object before returning it.

INHERITANCE

Lucy::Search::ORQuery isa Lucy::Search::PolyQuery isa Lucy::Search::Query isa Clownfish::Obj.