Actions Status

NAME

OpenSearch - Unofficial Perl client for OpenSearch (https://opensearch.org/)

SYNOPSIS

use OpenSearch;

my $opensearch = OpenSearch->new(
  user            => 'admin',
  pass            => 'password',
  hosts           => [ 'http://localhost:9200' ],
  secure          => 0,
  allow_insecure  => 1,
  pool_count      => 10,
  clear_attrs     => 0,
  async           => 0,
  max_connections => 10,
);

my $cluster = $opensearch->cluster;
my $remote  = $opensearch->remote;
my $search  = $opensearch->search;
my $index   = $opensearch->index;
my $document = $opensearch->document;

DESCRIPTION

OpenSearch is an unofficial Perl client for OpenSearch (https://opensearch.org/). Currently it only supports a subset of the OpenSearch API. However, it is a work in progress and more features will be added in the future. Currently, the following endpoints are (partially) supported:

IMPORTANT

This module is still in development and should not be used in production unless you are willing to accept the risks associated with using an incomplete and untested module. It heavily relies on Moose and Mojo::UserAgent. Due to the use of Moose, startup time is slower than other modules. However, the use of Mojo::UserAgent allows for asynchronous requests to be made to the OpenSearch server.

CERTIFICATE AUTHENTICATION IS NOT YET TESTED! Feel free to test it and report back to me.

METHODS

new

Creates a new instance of OpenSearch.

cluster

Returns a new instance of OpenSearch::Cluster.

remote

Returns a new instance of OpenSearch::Remote.

Returns a new instance of OpenSearch::Search.

index

Returns a new instance of OpenSearch::Index.

document

Returns a new instance of OpenSearch::Document.

ATTRIBUTES

CAVEATS

I am not affiliated with OpenSearch. This module is not officially supported by OpenSearch. If speed is a concern, you may want to consider using a different module (or maybe language). Using 'async' while also using 'max_connections' and 'pool_count' will result in better performance.

Using the following options:

async           => 1,
pool_count      => 10,
max_connections => 50,

will result in around 1000 requests per second (on my machine). However, using the following options:

async           => 0,
pool_count      => 10,
max_connections => 50,

will result in a maximum of around 200 requests per second (on my machine). This was tested using

$os->document->index();

with a small test-document:

{
  test    => 'test',
  test1   => 'test1',
  nesting => {
    test  => 'test',
    test1 => 'test1',
    test2 => [ 
      { 
        wurst => '123' 
      }, 
      { 
        asd => [ 1, 2, 3, 4 ] 
      } 
    ]
  }
}

AUTHOR

OpenSearch Perl Module was written by Sebastian Grenz, <git at fail.ninja>