How to get elasticsearch version with Perl api?


(Dominic Nicholas) #1

Hi,

I'm using the https://metacpan.org/pod/Search::Elasticsearch module and want to get the versions of elasticsearch and lucene. What is the equivalent of curl http://localhost:9200 via the Perl 1.20 api please ? I've read the docs but maybe am missing a simple version method somewhere ? I've tried the following ...

  1. $e->cluster->info - results in an 'Can't locate object method "info" via package "Search::Elasticsearch::Client::Direct::Cluster" error

  2. $e->get( index => '', type => '', id => '' ) which results in an '[Param] ** Missing required param (index) in (get) request.' error

Thanks for any help!
Dom


(Clinton Gormley) #2

This will do it:

$e->info

(Dominic Nicholas) #3

Perfect - thanks!


(system) #4