16 Apr 2012 21:20:13 UTC
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (536 / 133 / 8)
- KwaliteeBus factor: 0
- 85.27% Coverage
- License: perl_5
- Activity24 month
- Download (852.87KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCREAMYG Marvin Humphreyand 1 contributors
- Marvin Humphrey <marvin at rectangular dot com>
- COPYRIGHT AND LICENSE
KinoSearch::Search::RangeQuery - Match a range of values.
The KinoSearch code base has been assimilated by the Apache Lucy project. The "KinoSearch" namespace has been deprecated, but development continues under our new name at our new home: http://lucy.apache.org/
# Match all articles by "Foo" published since the year 2000. my $range_query = KinoSearch::Search::RangeQuery->new( field => 'publication_date', lower_term => '2000-01-01', include_lower => 1, ); my $author_query = KinoSearch::Search::TermQuery->new( field => 'author_last_name', text => 'Foo', ); my $and_query = KinoSearch::Search::ANDQuery->new( children => [ $range_query, $author_query ], ); my $hits = $searcher->hits( query => $and_query ); ...
RangeQuery matches documents where the value for a particular field falls within a given range.
my $range_query = KinoSearch::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;
fieldis required, as is at least one of either
field - The name of a
lower_term - Lower delimiter. If not supplied, all values less than
upper_term - Upper delimiter. If not supplied, all values greater than
include_lower - Indicates whether docs which match
lower_termshould be included in the results.
include_upper - Indicates whether docs which match
upper_termshould be included in the results.
Copyright 2005-2011 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.