| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 | = Elasticsearch.pm== OverviewSearch::Elasticsearch is the official Perl API for Elasticsearch. The fulldocumentation is available on https://metacpan.org/module/Search::Elasticsearch.It can be installed with:[source,sh]------------------------------------cpanm Search::Elasticsearch------------------------------------=== FeaturesThis client provides:* Full support for all Elasticsearch APIs* HTTP backend (blocking and asynchronous with https://metacpan.org/module/Search::Elasticsearch::Async)* Robust networking support which handles load balancing, failure detection and failover* Good defaults* Helper utilities for more complex operations, such as bulk indexing, scrolled searches and reindexing.* Logging support via Log::Any* Compatibility with the official clients for Python, Ruby, PHP and Javascript* Easy extensibility== Synopsis[source,perl]------------------------------------use Search::Elasticsearch;# Connect to localhost:9200:my $e = Search::Elasticsearch->new();# Round-robin between two nodes:my $e = Search::Elasticsearch->new(    nodes => [        'search1:9200',        'search2:9200'    ]);# Connect to cluster at search1:9200, sniff all nodes and round-robin between them:my $e = Search::Elasticsearch->new(    nodes    => 'search1:9200',    cxn_pool => 'Sniff');# Index a document:$e->index(    index   => 'my_app',    type    => 'blog_post',    id      => 1,    body    => {        title   => 'Elasticsearch clients',        content => 'Interesting content...',        date    => '2014-09-24'    });# Get the document:my $doc = $e->get(    index   => 'my_app',    type    => 'blog_post',    id      => 1);# Search:my $results = $e->search(    index => 'my_app',    body  => {        query => {            match => { title => 'elasticsearch' }        }    });------------------------------------[[v0_90]]== Elasticsearch 0.90.* and earlierThe current version of the client supports the Elasticsearch 1.0 branch bydefault, which is not backwards compatible with the 0.90 branch.If you need to talk to a version of Elasticsearch before 1.0.0,please use `Search::Elasticsearch::Client::0_90::Direct` as follows:[source,perl]------------------------------------    $es = Search::Elasticsearch->new(        client => '0_90::Direct'    );------------------------------------== Reporting issuesThe GitHub repository is https://github.com/elastic/elasticsearch-perland any issues can be reported on the issues list athttps://github.com/elastic/elasticsearch-perl/issues.== ContributingOpen source contributions are welcome. Please read ourhttps://github.com/elastic/elasticsearch-perl/blob/master/CONTRIBUTING.asciidoc[guide to contributing].== Copyright and LicenseThis software is Copyright (c) 2013-2018 by Elasticsearch BV.This is free software, licensed under:https://github.com/elastic/elasticsearch-perl/blob/master/LICENSE.txt[The Apache License Version 2.0].
 |