The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Search::OpenSearch::Response::ExtJS - provide search results in JSON format for ExtJS


 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  => 'ExtJS',             # or JSON, XML
 print $response;


Search::OpenSearch::Response::ExtJS serializes to JSON suitable for the ExtJS Javascript library.


This class is a subclass of Search::OpenSearch::Response::JSON. Only new or overridden methods are documented here.


Returns the Response in JSON format.

Response objects are overloaded to call stringify().


Returns appropriate MIME type for the format returned by stringify().



The metaData and success attributes are present to support the ExtJS specification.


Peter Karman, <karman at>


Please report any bugs or feature requests to bug-search-opensearch at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Search::OpenSearch::Response

You can also look for information at:


Copyright 2010 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 for more information.