Search...ct::SQL(3pm)

πŸ“¦
version 8.12 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 Search::Elasticsearch::Client::8_0::Direct::SQL β€” the 3pm manual page, but make it cute 🌸

okay bestie, welcome to the User Contributed Perl Documentation section, we're doing SQL stuff today and it's gonna be iconic πŸ’…


✨ NAME ✨

Search::Elasticsearch::Client::8_0::Direct::SQL β€” it's a plugin that brings the SQL to your Search::Elasticsearch 8.x, no cap 🫢


πŸŽ€ VERSION πŸŽ€

version 8.12 β€” that's the one, periodt.


🌈 SYNOPSIS 🌈

my $response = $es->sql->query( body => {...} )

that's it, that's the whole vibe check. look at her go ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this class extends the Search::Elasticsearch client with a whole "sql" namespace, and that namespace exists to support the SQL APIs β€” you can find those over at:

<https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest.html>

and if you want the full full documentation for the SQL feature (the whole meal, not just the snack), it lives right here:

<https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-sql.html>

go read it, i'll wait πŸ“


πŸ‘‘ GENERAL METHODS πŸ‘‘

⭐ query()

$response = $es->sql->query(
    body    => {...} # required
)

the query() method executes an SQL query and hands you back the results. like, you ask, it answers, main character energy fr fr.

query string parameters you can pass:

  • "error_trace"
  • "filter_path"
  • "format"
  • "human"

want the deets? the query docs are right here, go off:

<https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest.html>


🧚 translate()

$response = $es->sql->translate(
    body    => {...} # required
)

the translate() method takes an SQL query and gives you back the query DSL that would actually get executed. it's giving translator, it's giving "here's what you really meant" πŸ’œ

query string parameters:

  • "error_trace"
  • "filter_path"
  • "human"

the translate docs are over here if you're nosy (affectionate):

<https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html>


🫢 clear_cursor()

$response = $es->sql->clear_cursor(
    body    => {...} # required
)

the clear_cursor() method cleans up an ongoing scroll request. tidy queen behaviour, we love to see it ✨

query string parameters:

  • "error_trace"
  • "filter_path"
  • "human"

and yep, the docs for this one are the query docs (same link as query(), that's just how it is bestie):

<https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest.html>


πŸ’– AUTHOR πŸ’–

Enrico Zimuel <enrico.zimuel@elastic.co> β€” thank you for your service 🫑


This software is Copyright (c) 2024 by Elasticsearch BV.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004

and that's a wrap!! this page was served up by perl v5.38.2 on 2024-02-04, mwah πŸ’‹ stay slaying, bestie, and remember: read your docs before you ship πŸ”₯

πŸ“¦ where this page comes from