Nicolas Steenlant > Catmandu-0.07 > Catmandu::Searchable

Download:
Catmandu-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Catmandu-0.9209

NAME ^

Catmandu::Searchable - Base class for all searchable Catmandu classes

SYNOPSIS ^

    my $store = Catmandu::Store::Solr->new();

    # Return one page of search results (page size = 1000)
    my $hits  = $store->bag->search(
                   query => 'dna' ,
                   start => 0 ,
                   limit => 100 ,
                   sort  => 'title desc',
                );

    # Return all the search results as iterator
    my $it    = $store->bag->searcher(query => 'dna');
    $it->each(sub { ...});

    $store->bag->delete_by_query(query => 'dna');

METHODS ^

search(query => $query, start => $start, limit => $num, sort => $sort, cql_query => $cql)

Search the database and returns a Catmandu::Hits on success. The Hits represents one result page of at most $num results. The $query and $sort should implement the query and sort syntax of the underlying search engine. If the CQL language is supported by the Store, then optionally a $cql_query search can be excuted on the Searchable.

searcher(query => $query, start => $start, limit => $num, sort => $sort, cql_query => $cql)

Search the database and return a Catmandu::Iterable on success. This iterator can be used to loop over the complete result set. The $query and $sort should implement the query and sort syntax of the underlying search engine. If the CQL language is supported by the Store, then optionally a $cql_query search can be excuted on the Searchable.

delete_by_query(query => $query)

Delete items from the database that match $query

SEE ALSO ^

Catmandu::Hits

syntax highlighting: