-
-
31 Dec 2014 03:15:36 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Clone repository
- Issues
- Testers (1056 / 65 / 0)
- Kwalitee
Bus factor: 1- License: apache_2_0
- Perl: v5.8.3
- Activity
24 month- Tools
- Download (1.06MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- The Apache Lucy Project <dev at lucy dot apache dot org>
- Dependencies
- Clownfish
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Lucy::Search::SortSpec - Specify a custom sort order for search results.
SYNOPSIS
my $sort_spec = Lucy::Search::SortSpec->new( rules => [ Lucy::Search::SortRule->new( field => 'date' ), Lucy::Search::SortRule->new( type => 'doc_id' ), ], ); my $hits = $searcher->hits( query => $query, sort_spec => $sort_spec, );
DESCRIPTION
By default, searches return results in order of relevance; SortSpec allows you to indicate an alternate order via an array of SortRules.
Fields you wish to sort against must be
sortable
.For a stable sort (important when paging through results), add a sort-by-doc rule as the last SortRule.
CONSTRUCTORS
new( [labeled params] )
my $sort_spec = Lucy::Search::SortSpec->new( rules => \@rules );
rules - An array of SortRules.
INHERITANCE
Lucy::Search::SortSpec isa Clownfish::Obj.
Module Install Instructions
To install Lucy::Simple, copy and paste the appropriate command in to your terminal.
cpanm Lucy::Simple
perl -MCPAN -e shell install Lucy::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.