31 Dec 2014 03:15:36 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Testers (1056 / 65 / 0)
- KwaliteeBus factor: 1
- License: apache_2_0
- Perl: v5.8.3
- Activity24 month
- Download (1.06MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:6 non-PAUSE usersCREAMYG Marvin Humphreyand 1 contributors
- The Apache Lucy Project <dev at lucy dot apache dot org>
Lucy::Search::SortRule - Element of a SortSpec.
my $sort_spec = Lucy::Search::SortSpec->new( rules => [ Lucy::Search::SortRule->new( field => 'date' ), Lucy::Search::SortRule->new( type => 'doc_id' ), ], );
SortRules are the building blocks used to assemble SortSpecs; each SortRule defines a single level of sorting. For example, sorting first by "category" then by score requires a SortSpec with two SortRule elements.
my $by_title = Lucy::Search::SortRule->new( field => 'title' ); my $by_score = Lucy::Search::SortRule->new( type => 'score' ); my $by_doc_id = Lucy::Search::SortRule->new( type => 'doc_id' ); my $reverse_date = Lucy::Search::SortRule->new( field => 'date', reverse => 1, );
type - Indicate whether to sort by score, field, etc. (The default is to sort by a field.)
field - The name of a
reverse - If true, reverse the order of the sort for this rule.
Accessor for "field" member.
Accessor for "reverse" member.
Lucy::Search::SortRule isa Clownfish::Obj.