| 1 | # Licensed to Elasticsearch B.V under one or more agreements. | ||
| 2 | # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
| 3 | # See the LICENSE file in the project root for more information | ||
| 4 | |||
| 5 | package Search::Elasticsearch::Client::7_0::Direct::SQL; | ||
| 6 | $Search::Elasticsearch::Client::7_0::Direct::SQL::VERSION = '7.30_1'; # TRIAL | ||
| 7 | |||
| 8 | $Search::Elasticsearch::Client::7_0::Direct::SQL::VERSION = '7.301'; | ||
| 9 | use Moo; | ||
| 10 | with 'Search::Elasticsearch::Client::7_0::Role::API'; | ||
| 11 | with 'Search::Elasticsearch::Role::Client::Direct'; | ||
| 12 | use namespace::clean; | ||
| 13 | |||
| 14 | __PACKAGE__->_install_api('sql'); | ||
| 15 | |||
| 16 | 1; | ||
| 17 | |||
| 18 | =pod | ||
| 19 | |||
| 20 | =encoding UTF-8 | ||
| 21 | |||
| 22 | =head1 NAME | ||
| 23 | |||
| 24 | Search::Elasticsearch::Client::7_0::Direct::SQL - Plugin providing SQL for Search::Elasticsearch 7.x | ||
| 25 | |||
| 26 | =head1 VERSION | ||
| 27 | |||
| 28 | version 7.30_1 | ||
| 29 | |||
| 30 | =head1 SYNOPSIS | ||
| 31 | |||
| 32 | my $response = $es->sql->query( body => {...} ) | ||
| 33 | |||
| 34 | =head2 DESCRIPTION | ||
| 35 | |||
| 36 | This class extends the L<Search::Elasticsearch> client with an C<sql> | ||
| 37 | namespace, to support the | ||
| 38 | L<SQL APIs|https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest.html>. | ||
| 39 | |||
| 40 | The full documentation for the SQL feature is available here: | ||
| 41 | L<https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-sql.html> | ||
| 42 | |||
| 43 | =head1 GENERAL METHODS | ||
| 44 | |||
| 45 | =head2 C<query()> | ||
| 46 | |||
| 47 | $response = $es->sql->query( | ||
| 48 | body => {...} # required | ||
| 49 | ) | ||
| 50 | |||
| 51 | The C<query()> method executes an SQL query and returns the results. | ||
| 52 | |||
| 53 | Query string parameters: | ||
| 54 | C<error_trace>, | ||
| 55 | C<filter_path>, | ||
| 56 | C<format>, | ||
| 57 | C<human> | ||
| 58 | |||
| 59 | See the L<query docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest.html> | ||
| 60 | for more information. | ||
| 61 | |||
| 62 | =head2 C<translate()> | ||
| 63 | |||
| 64 | $response = $es->sql->translate( | ||
| 65 | body => {...} # required | ||
| 66 | ) | ||
| 67 | |||
| 68 | The C<translate()> method takes an SQL query and returns the query DSL which would be executed. | ||
| 69 | |||
| 70 | Query string parameters: | ||
| 71 | C<error_trace>, | ||
| 72 | C<filter_path>, | ||
| 73 | C<human> | ||
| 74 | |||
| 75 | See the L<translate docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html> | ||
| 76 | for more information. | ||
| 77 | |||
| 78 | =head2 C<clear_cursor()> | ||
| 79 | |||
| 80 | $response = $es->sql->clear_cursor( | ||
| 81 | body => {...} # required | ||
| 82 | ) | ||
| 83 | |||
| 84 | The C<clear_cursor()> method cleans up an ongoing scroll request. | ||
| 85 | |||
| 86 | Query string parameters: | ||
| 87 | C<error_trace>, | ||
| 88 | C<filter_path>, | ||
| 89 | C<human> | ||
| 90 | |||
| 91 | See the L<query docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest.html> | ||
| 92 | for more information. | ||
| 93 | |||
| 94 | =head1 AUTHOR | ||
| 95 | |||
| 96 | Enrico Zimuel <enrico.zimuel@elastic.co> | ||
| 97 | |||
| 98 | =head1 COPYRIGHT AND LICENSE | ||
| 99 | |||
| 100 | This software is Copyright (c) 2020 by Elasticsearch BV. | ||
| 101 | |||
| 102 | This is free software, licensed under: | ||
| 103 | |||
| 104 | The Apache License, Version 2.0, January 2004 | ||
| 105 | |||
| 106 | =cut | ||
| 107 | |||
| 108 | __END__ |