| Data-SearchEngine documentation | view source | Contained in the Data-SearchEngine distribution. |
Data::SearchEngine::Query - Query to pass to an engine.
The query object has some common attributes one would expect when performing a search. It has the added benefit of producing a digest that can be used with Data::SearchEngine::Results ability to serialize to implement caching.
If you add new attributes to a subclass, be sure and add the Digestable trait to any attributes you want to be included in the digest as document in Data::SearchEngine::Meta::Attribute::Trait::Digestable.
The number of results this query should return.
A HashRef of filters used with the query. The key should be the filter name and the value is the filter's value. Consult the documentation for your backend to see how this is used.
The order in which the results should be sorted.
The "original" query that the user searched for. Provided because some
backends may need to modify the query attribute to a more palatable form.
If no value is provided for this attribute then it will assume the same
value as query.
Which page of results to show.
The query string to search for.
Returns a unique digest identifying this Query. Useful as a key when caching.
Return an array of filter names that are present in this query.
Gets the value for the specified filter.
Predicate that returns true if this query has filters.
Returns true if any of the filter names match the provided subroutine:
$query->set_filter('foo', 'bar');
$query->has_filter_like(sub { /^fo/ })s; # true!
Returns true if this Query has a query string.
Sets the value for the specified filter.
Cory G Watson, <gphat at cpan.org>
Copyright 2009 Cory G Watson
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
| Data-SearchEngine documentation | view source | Contained in the Data-SearchEngine distribution. |