NAME

OpenSearch::Client::Core::3_0::Direct::SQL

VERSION

version 3.007005

SYNOPSIS

use OpenSearch::Client;

my $client = OpenSearch::Client->new( ... );

my $response = $client->sql-><methodname>(
  valone => $value1,
  valtwo => $value2
);

DESCRIPTION

SQL

Use the SQL and PPL API to send queries to the SQL plugin. Use the _sql endpoint to send queries in SQL, and the _ppl endpoint to send queries in PPL. For both of these, you can also use the _explain endpoint to translate your query into OpenSearch domain-specific language (DSL) or to troubleshoot errors.

METHODS

sql->close

Closes an open cursor to free server-side resources.

Paths served by this method:

POST /_plugins/_sql/close
$resp = $client->sql->close(
    
    'body'         =>  $body,      # optional
    
     # Endpoint specific query string parameters
    
    'format'       =>  $qval1,     # string
    'sanitize'     =>  $qval2,     # boolean
    
     # Common API query string parameters
    
    'error_trace'  =>  $qval3,     # boolean
    'filter_path'  =>  $qval4,     # list
    'human'        =>  $qval5,     # boolean
    'pretty'       =>  $qval6,     # boolean
    'source'       =>  $qval7,     # string
);

OpenSearch documentation for sql.close

sql->explain

Returns the execution plan for a SQL or PPL query.

Paths served by this method:

POST /_plugins/_sql/_explain
$resp = $client->sql->explain(
    
    'body'         =>  $body,      # optional
    
     # Endpoint specific query string parameters
    
    'format'       =>  $qval1,     # string
    'sanitize'     =>  $qval2,     # boolean
    
     # Common API query string parameters
    
    'error_trace'  =>  $qval3,     # boolean
    'filter_path'  =>  $qval4,     # list
    'human'        =>  $qval5,     # boolean
    'pretty'       =>  $qval6,     # boolean
    'source'       =>  $qval7,     # string
);

OpenSearch documentation for sql.explain

sql->get_stats

Retrieves performance metrics for the SQL plugin.

Paths served by this method:

GET /_plugins/_sql/stats
$resp = $client->sql->get_stats(
    
     # Endpoint specific query string parameters
    
    'format'       =>  $qval1,     # string
    'sanitize'     =>  $qval2,     # boolean
    
     # Common API query string parameters
    
    'error_trace'  =>  $qval3,     # boolean
    'filter_path'  =>  $qval4,     # list
    'human'        =>  $qval5,     # boolean
    'pretty'       =>  $qval6,     # boolean
    'source'       =>  $qval7,     # string
);

OpenSearch documentation for sql.get_stats

sql->post_stats

Retrieves filtered performance metrics for the SQL plugin.

Paths served by this method:

POST /_plugins/_sql/stats
$resp = $client->sql->post_stats(
    
    'body'         =>  $body,      # optional
    
     # Endpoint specific query string parameters
    
    'format'       =>  $qval1,     # string
    'sanitize'     =>  $qval2,     # boolean
    
     # Common API query string parameters
    
    'error_trace'  =>  $qval3,     # boolean
    'filter_path'  =>  $qval4,     # list
    'human'        =>  $qval5,     # boolean
    'pretty'       =>  $qval6,     # boolean
    'source'       =>  $qval7,     # string
);

OpenSearch documentation for sql.post_stats

sql->query

Executes SQL or PPL queries against OpenSearch indexes.

Paths served by this method:

POST /_plugins/_sql
$resp = $client->sql->query(
    
    'body'         =>  $body,      # optional
    
     # Endpoint specific query string parameters
    
    'format'       =>  $qval1,     # string
    'sanitize'     =>  $qval2,     # boolean
    
     # Common API query string parameters
    
    'error_trace'  =>  $qval3,     # boolean
    'filter_path'  =>  $qval4,     # list
    'human'        =>  $qval5,     # boolean
    'pretty'       =>  $qval6,     # boolean
    'source'       =>  $qval7,     # string
);

OpenSearch documentation for sql.query

sql->settings

Updates SQL plugin settings in the OpenSearch cluster configuration.

Paths served by this method:

PUT /_plugins/_query/settings
$resp = $client->sql->settings(
    
    'body'         =>  $body,      # optional
    
     # Endpoint specific query string parameters
    
    'format'       =>  $qval1,     # string
    
     # Common API query string parameters
    
    'error_trace'  =>  $qval2,     # boolean
    'filter_path'  =>  $qval3,     # list
    'human'        =>  $qval4,     # boolean
    'pretty'       =>  $qval5,     # boolean
    'source'       =>  $qval6,     # string
);

OpenSearch documentation for sql.settings

MANUAL

Documentation index OpenSearch::Client::Manual

HISTORY

This distribution is derived from Search::Elasticsearch version 7.714. All subsequent changes are unique to this distribution.

AUTHOR

Mark Dootson <mdootson@cpan.org> ( current maintainer )

CREDITS

OpenSearch::Client is based on Search::Elasticsearch version 7.714 by Enrico Zimuel <enrico.zimuel@elastic.co>.

COPYRIGHT AND LICENSE

Copyright (C) 2026 by Mark Dootson ( this distribution )

Copyright (C) 2021 by Elasticsearch BV ( original distribution )

This is free software, licensed under:

The Apache License, Version 2.0, January 2004