Search::OpenSearch::Response::Tiny - provide minimal search results in JSON format
use Search::OpenSearch; my $engine = Search::OpenSearch->engine( type => 'Lucy', index => [qw( path/to/index1 path/to/index2 )], facets => { names => [qw( color size flavor )], sample_size => 10_000, }, fields => [qw( color size flavor )], ); my $response = $engine->search( q => 'quick brown fox', # query s => 'score desc', # sort order o => 0, # offset p => 25, # page size h => 1, # highlight query terms in results c => 0, # return count stats only (no results) L => 'field|low|high', # limit results to inclusive range f => 1, # include facets r => 1, # include results t => 'Tiny', # or JSON, XML, ExtJS x => [qw( foo bar )], # return only a subset of fields ); print $response;
Search::OpenSearch::Response::Tiny serializes to a minimal JSON string. The only keys present will be:
results facets total version
Use the Tiny format with the x parameter to the Engine to create a minimal response size.
This class is a subclass of Search::OpenSearch::Response::JSON. Only new or overridden methods are documented here.
Returns the Response in minimal JSON format.
Response objects are overloaded to call stringify().
Peter Karman, <karman at cpan.org>
<karman at cpan.org>
Please report any bugs or feature requests to bug-search-opensearch at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Search-OpenSearch. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-search-opensearch at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Search::OpenSearch::Response
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Search-OpenSearch
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Search-OpenSearch
CPAN Ratings
http://cpanratings.perl.org/d/Search-OpenSearch
Search CPAN
http://search.cpan.org/dist/Search-OpenSearch/
Copyright 2012 Peter Karman.
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.
To install Search::OpenSearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Search::OpenSearch
CPAN shell
perl -MCPAN -e shell install Search::OpenSearch
For more information on module installation, please visit the detailed CPAN module installation guide.