Lucy::Search::RangeQuery(3pm)

Lucy::Search::RangeQuery3pm

Match a range of values.

Usage

    # Match all articles by "Foo" published since the year 2000.
    my $range_query = Lucy::Search::RangeQuery->new(
        field         => 'publication_date',
        lower_term    => '2000-01-01',
        include_lower => 1,
    );
    my $author_query = Lucy::Search::TermQuery->new(
        field => 'author_last_name',
        text  => 'Foo',
    );
    my $and_query = Lucy::Search::ANDQuery->new(
        children => [ $range_query, $author_query ],
    );
    my $hits = $searcher->hits( query => $and_query );
    ...

Overview

RangeQuery matches documents where the value for a particular field falls within a given range.

Constructors

new( [labeled params] )

    my $range_query = Lucy::Search::RangeQuery->new(
        field         => 'product_number', # required
        lower_term    => '003',            # see below
        upper_term    => '060',            # see below
        include_lower => 0,                # default true
        include_upper => 0,                # default true
    );

Takes 5 parameters; "field" is required, as is at least one of either "lower_term" or "upper_term".

•

field - The name of a "sortable" field.

•

lower_term - Lower delimiter. If not supplied, all values less than "upper_term" will pass.

•

upper_term - Upper delimiter. If not supplied, all values greater than "lower_term" will pass.

•

include_lower - Indicates whether docs which match "lower_term" should be included in the results.

•

include_upper - Indicates whether docs which match "upper_term" should be included in the results.

Inheritance

Lucy::Search::RangeQuery isa Lucy::Search::Query isa Lucy::Object::Obj.

Releases

2 releases since Debian 8 (Jessie); the text changed 1 time.

  1. 8
  2. 9

From liblucy-perl 0.3.3-7+b1 in Debian 9 (Stretch). Parsed by carta from the page's man source.