diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile
index 5c4b64c2ab..f851f4369f 100644
--- a/.buildkite/Dockerfile
+++ b/.buildkite/Dockerfile
@@ -1,34 +1,17 @@
ARG RUBY_VERSION=${RUBY_VERSION:-3.1}
-FROM ruby:$RUBY_VERSION
-
-# Default UID/GID to 1000
-# it can be overridden at build time
-ARG BUILDER_UID=1000
-ARG BUILDER_GID=1000
-ENV BUILDER_USER elastic
-ENV BUILDER_GROUP elastic
+ARG RUBY_SOURCE=${RUBY_SOURCE:-ruby}
+FROM $RUBY_SOURCE:$RUBY_VERSION
ARG QUIET=${QUIET:-true}
ARG CI=${CI:-false}
ENV QUIET=$QUIET
ENV CI=$CI
+ARG TRANSPORT_VERSION=${TRANSPORT_VERSION:-8}
# Install required tools
-RUN apt-get -q update \
- && apt-get -y install zip curl
-
-# Create user
-RUN groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP} \
- && useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GROUP} -d /var/lib/elastic -m elastic 1>/dev/null 2>/dev/null \
- && mkdir -p /usr/src/app && touch /Gemfile.lock \
- && chown -R ${BUILDER_USER}:${BUILDER_GROUP} /usr/src/app /Gemfile.lock
-
-COPY --chown=$BUILDER_USER:$BUILDER_GROUP . .
-
+RUN apt-get -q update && apt-get -y install zip curl git
WORKDIR /usr/src/app
-
-USER ${BUILDER_USER}:${BUILDER_GROUP}
-
+COPY . .
RUN bundle install \
&& bundle exec rake bundle:clean \
&& rake bundle:install
diff --git a/.buildkite/create-serverless.sh b/.buildkite/create-serverless.sh
new file mode 100755
index 0000000000..7b7d2c1dcf
--- /dev/null
+++ b/.buildkite/create-serverless.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+if [[ -z $EC_PROJECT_PREFIX ]]; then
+ echo -e "\033[31;1mERROR:\033[0m Required environment variable [EC_PROJECT_PREFIX] not set\033[0m"
+ exit 1
+fi
+
+# Using BUILDKITE_JOB_ID for the name to make it unique:
+export EC_PROJECT_NAME="$EC_PROJECT_PREFIX-$BUILDKITE_JOB_ID"
+echo -e "--- :elasticsearch: Start serverless instance $EC_PROJECT_NAME"
+
+qaf elastic-cloud projects create --project-type elasticsearch
+deployment=$(qaf elastic-cloud projects describe $EC_PROJECT_NAME --as-json --show-credentials)
+
+# Set ELASTICSEARCH_URL and API_KEY variables
+export ES_API_SECRET_KEY=$(echo "$deployment" | jq -r '.credentials.api_key')
+export ELASTICSEARCH_URL=$(echo "$deployment" | jq -r '.elasticsearch.url')
+buildkite-agent meta-data set "ES_API_SECRET_KEY" $ES_API_SECRET_KEY
+buildkite-agent meta-data set "ELASTICSEARCH_URL" $ELASTICSEARCH_URL
+buildkite-agent meta-data set "EC_PROJECT_NAME" $EC_PROJECT_NAME
+
+echo -e "--- :computer: Environment variables"
+echo -e "ELASTICSEARCH_URL $ELASTICSEARCH_URL"
diff --git a/.buildkite/functions/wait-for-container.sh b/.buildkite/functions/wait-for-container.sh
index 1a721b588f..89d65f4e7d 100755
--- a/.buildkite/functions/wait-for-container.sh
+++ b/.buildkite/functions/wait-for-container.sh
@@ -14,7 +14,7 @@ function wait_for_container {
echo ""
docker inspect -f "{{range .State.Health.Log}}{{.Output}}{{end}}" ${1}
echo -e "\033[34;1mINFO:\033[0m waiting for node $1 to be up\033[0m"
- sleep 2;
+ sleep 10;
done;
# Always show logs if the container is running, this is very useful both on CI as well as while developing
diff --git a/.buildkite/log-results.sh b/.buildkite/log-results.sh
index 7e3f9c922a..d3fb1c4e43 100755
--- a/.buildkite/log-results.sh
+++ b/.buildkite/log-results.sh
@@ -5,32 +5,20 @@ buildkite-agent annotate --style info "## :rspec: Tests summary :rspec:
"
buildkite-agent artifact download "elasticsearch-api/tmp/*" .
-# Test result summary:
-files="elasticsearch-api/tmp/*.html"
+files="elasticsearch-api/tmp/*.log"
for f in $files; do
- TEST_SUITE=`echo $f | grep -o "\(free\|platinum\)"`
- RUBY_VERSION=`echo $f | grep -Po "(\d+\.)+\d+"`
- EXAMPLES=`cat $f | grep -o "[0-9]\+ examples\?" | tail -1`
- FAILURES=`cat $f | grep -o "[0-9]\+ failures\?" | tail -1`
- PENDING=`cat $f | grep -o "[0-9]\+ pending" | tail -1`
+ RUBY_VERSION=`echo $f | grep -Po "(j?ruby-|\d+\.)+\d+" | tail -1`
+ TRANSPORT_VERSION=`echo $f | grep -Po "transport-([\d.]+|main)"`
buildkite-agent annotate --append "
-:ruby: $RUBY_VERSION :test_tube: $TEST_SUITE :rspec: $EXAMPLES - :x: $FAILURES - :suspect: $PENDING
+:ruby: $RUBY_VERSION :phone: $TRANSPORT_VERSION `tail --lines=2 $f | awk -F "-- :" '{print $2}'`
+
"
-done
-files="elasticsearch-api/tmp/*.log"
-for f in $files; do
- FAILED_TESTS=`awk 'BEGIN { FS = " | "}; /\| failed \|/{ print $1 }' $f | uniq`
+ FAILED_TESTS=`grep -A1 "E,.*" $f | sed 's/\#/-/g' | sed 's/^--/\n/g'`
if [[ -n "$FAILED_TESTS" ]]; then
- buildkite-agent annotate --append "
-#### Failures in $f
-"
- FAILURES_ARRAY=($(echo $FAILED_TESTS | tr ' ' "\n"))
- for f in "${FAILURES_ARRAY[@]}"
- do
- buildkite-agent annotate --append "
-- $f
-"
- done
+ buildkite-agent annotate --append ""
+ buildkite-agent annotate --append ":x: Failures in $f
+$FAILED_TESTS
+ "
fi
done
diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index a6f11c5a41..1fdc76b1fd 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -1,36 +1,93 @@
steps:
- - label: ":elasticsearch: :ruby: ES Ruby ({{ matrix.ruby }}) Test Suite: {{ matrix.suite }}"
+ - label: >-
+ :yaml: YAML test suite :ruby: {{ matrix.ruby_source}}:{{ matrix.ruby }}
+ :phone: Transport {{ matrix.transport }}
agents:
- provider: "gcp"
- env:
- RUBY_VERSION: "{{ matrix.ruby }}"
- TEST_SUITE: "{{ matrix.suite }}"
- STACK_VERSION: 8.10.0-SNAPSHOT
+ provider: gcp
matrix:
setup:
- suite:
- - "free"
- - "platinum"
ruby:
- - "3.2"
- - "3.1"
- - "3.0"
- # Only run platinum once for the latest Ruby. You can use lots of combinations, check the
- # documentation on https://buildkite.com/docs/pipelines/build-matrix for more information.
+ - '3.4'
+ - '3.3'
+ - '3.2'
+ ruby_source:
+ - ruby
+ transport:
+ - '8.4'
adjustments:
- - with:
- suite: "platinum"
- ruby: "3.1"
- skip: true
- - with:
- suite: "platinum"
- ruby: "3.0"
- skip: true
- command: ./.buildkite/run-tests.sh
- # I'm publishing test results to HTML and JUnit in this directory and this directive makes them
- # available in the Artifacts tab of a build in Buildkite.
- artifact_paths: "elasticsearch-api/tmp/*"
+ - with: # JRuby tests
+ ruby: '9.4'
+ ruby_source: jruby
+ transport: '8.4'
+ - with: # Test for main branch of transport
+ ruby: '3.4'
+ ruby_source: ruby
+ transport: main
+ env:
+ RUBY_VERSION: '{{ matrix.ruby }}'
+ STACK_VERSION: 9.1.0-SNAPSHOT
+ ES_YAML_TESTS_BRANCH: main
+ TRANSPORT_VERSION: '{{ matrix.transport }}'
+ RUBY_SOURCE: '{{ matrix.ruby_source }}'
+ TEST_SUITE: platinum
+ DEBUG: true
+ command: ./.buildkite/run-yaml-tests.sh
+ artifact_paths: elasticsearch-api/tmp/*
+ - group: 'Elasticsearch Serverless :elasticsearch:'
+ steps:
+ - label: 'Create :elasticsearch: Serverless projects'
+ key: create-serverless
+ agents:
+ image: 'docker.elastic.co/appex-qa/qaf:latest'
+ env:
+ EC_PROJECT_PREFIX: ruby
+ EC_REGISTER_BACKEND: buildkite
+ EC_REGION: aws-eu-west-1
+ EC_ENV: qa
+ commands:
+ - mkdir ~/.elastic
+ - touch ~/.elastic/cloud.json
+ - >-
+ echo "{\"api_key\":{\"qa\":\"$(vault read -field=qa
+ secret/ci/elastic-elasticsearch-ruby/cloud-access)\"}}" >
+ ~/.elastic/cloud.json
+ - ./.buildkite/create-serverless.sh
+ - label: 'Run :elasticsearch: Serverless :rspec: Tests :ruby:'
+ key: run-serverless-tests
+ depends_on:
+ - step: create-serverless
+ agents:
+ provider: gcp
+ env:
+ RUBY_VERSION: '3.4'
+ RUBY_SOURCE: ruby
+ TEST_SUITE: serverless
+ ES_YAML_TESTS_BRANCH: main
+ QUIET: false
+ command: ./.buildkite/run-yaml-tests.sh
+ artifact_paths: elasticsearch-api/tmp/*
+ - label: 'Destroy :elasticsearch: Serverless projects'
+ depends_on:
+ - step: run-serverless-tests
+ allow_failure: true
+ agents:
+ image: 'docker.elastic.co/appex-qa/qaf:latest'
+ env:
+ EC_REGISTER_BACKEND: buildkite
+ EC_ENV: qa
+ EC_REGION: aws-eu-west-1
+ commands:
+ - mkdir ~/.elastic
+ - touch ~/.elastic/cloud.json
+ - >-
+ export EC_PROJECT_NAME=`buildkite-agent meta-data get
+ "EC_PROJECT_NAME"`
+ - >-
+ echo "{\"api_key\":{\"qa\":\"$(vault read -field=qa
+ secret/ci/elastic-elasticsearch-ruby/cloud-access)\"}}" >
+ ~/.elastic/cloud.json
+ - qaf elastic-cloud projects delete
- wait: ~
continue_on_failure: true
- - label: "Log Results"
+ - label: Log Results
command: ./.buildkite/log-results.sh
diff --git a/.buildkite/run-client.sh b/.buildkite/run-client.sh
deleted file mode 100755
index 4f7cefba63..0000000000
--- a/.buildkite/run-client.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-#
-# Once called Elasticsearch should be up and running
-#
-script_path=$(dirname $(realpath -s $0))
-set -euo pipefail
-repo=`pwd`
-
-export RUBY_VERSION=${RUBY_VERSION:-3.1}
-
-echo "--- :ruby: Building Docker image"
-docker build \
- --file $script_path/Dockerfile \
- --tag elastic/elasticsearch-ruby \
- --build-arg RUBY_VERSION=$RUBY_VERSION \
- .
-
-mkdir -p elasticsearch-api/tmp
-
-echo "--- :ruby: Running $TEST_SUITE tests"
-docker run \
- -u "$(id -u)" \
- --network="${network_name}" \
- --env "TEST_ES_SERVER=${elasticsearch_url}" \
- --env "ELASTIC_PASSWORD=${elastic_password}" \
- --env "TEST_SUITE=${TEST_SUITE}" \
- --env "ELASTIC_USER=elastic" \
- --env "BUILDKITE=true" \
- --volume $repo:/usr/src/app \
- --name elasticsearch-ruby \
- --rm \
- elastic/elasticsearch-ruby \
- bundle exec rake elasticsearch:download_artifacts test:platinum:integration test:rest_api
diff --git a/.buildkite/run-serverless-tests.sh b/.buildkite/run-serverless-tests.sh
new file mode 100755
index 0000000000..d145d6e6d3
--- /dev/null
+++ b/.buildkite/run-serverless-tests.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+#
+# Once called Elasticsearch should be up and running
+#
+script_path=$(dirname $(realpath -s $0))
+set -euo pipefail
+repo=`pwd`
+
+export RUBY_VERSION=${RUBY_VERSION:-3.4}
+export BUILDKITE=${BUILDKITE:-false}
+export TRANSPORT_VERSION=${TRANSPORT_VERSION:-8}
+ELASTICSEARCH_URL=`buildkite-agent meta-data get "ELASTICSEARCH_URL"`
+ES_API_SECRET_KEY=`buildkite-agent meta-data get "ES_API_SECRET_KEY"`
+
+echo "--- :ruby: Building Docker image"
+docker build \
+ --file $script_path/Dockerfile \
+ --tag elastic/elasticsearch-ruby \
+ --build-arg RUBY_VERSION=$RUBY_VERSION \
+ --build-arg TRANSPORT_VERSION=$TRANSPORT_VERSION \
+ --build-arg RUBY_SOURCE=$RUBY_SOURCE \
+ .
+
+mkdir -p elasticsearch-api/tmp
+
+echo "--- :ruby: Running $TEST_SUITE tests"
+docker run \
+ -u "$(id -u)" \
+ -e "ELASTIC_USER=elastic" \
+ -e "QUIET=${QUIET}" \
+ -e "BUILDKITE=${BUILDKITE}" \
+ -e "TRANSPORT_VERSION=${TRANSPORT_VERSION}" \
+ -e "ELASTICSEARCH_URL=${ELASTICSEARCH_URL}" \
+ -e "ES_API_KEY=${ES_API_SECRET_KEY}" \
+ --volume $repo:/usr/src/app \
+ --name elasticsearch-ruby \
+ --rm \
+ elastic/elasticsearch-ruby \
+ bundle exec bundle exec rake test:yaml
diff --git a/.buildkite/run-tests.sh b/.buildkite/run-tests.sh
deleted file mode 100755
index 12a24c2912..0000000000
--- a/.buildkite/run-tests.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-#
-# Script to run Elasticsearch container and Elasticsearch client integration tests on Buildkite
-#
-# Version 0.1
-#
-script_path=$(dirname $(realpath -s $0))
-source $script_path/functions/imports.sh
-set -euo pipefail
-
-echo "--- :elasticsearch: Starting Elasticsearch"
-DETACH=true bash $script_path/run-elasticsearch.sh
-
-echo "+++ :ruby: Run Client"
-bash $script_path/run-client.sh
diff --git a/.buildkite/run-yaml-tests.sh b/.buildkite/run-yaml-tests.sh
new file mode 100755
index 0000000000..59faabb19c
--- /dev/null
+++ b/.buildkite/run-yaml-tests.sh
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+#
+# Script to run YAML runner integration tests on Buildkite
+#
+# Version 0.1
+#
+script_path=$(dirname $(realpath -s $0))
+
+if [[ "$TEST_SUITE" == "serverless" ]]; then
+ # Get Elasticsearch Serverless credentials and endpoint
+ export TEST_ES_SERVER=`buildkite-agent meta-data get "ELASTICSEARCH_URL"`
+ export ES_API_SECRET_KEY=`buildkite-agent meta-data get "ES_API_SECRET_KEY"`
+else
+ # Start Elasticsearch Stack on Docker
+ source $script_path/functions/imports.sh
+ echo "--- :elasticsearch: Starting Elasticsearch"
+ DETACH=true bash $script_path/run-elasticsearch.sh
+fi
+
+set -euo pipefail
+repo=`pwd`
+
+export RUBY_VERSION=${RUBY_VERSION:-3.1}
+export BUILDKITE=${BUILDKITE:-false}
+export TRANSPORT_VERSION=${TRANSPORT_VERSION:-8}
+export QUIET=${QUIET:-false}
+export DEBUG=${DEBUG:-false}
+export TEST_SUITE=${TEST_SUITE:-platinum}
+
+echo "--- :ruby: Building Docker image"
+docker build \
+ --file $script_path/Dockerfile \
+ --tag elastic/elasticsearch-ruby \
+ --build-arg RUBY_VERSION=$RUBY_VERSION \
+ --build-arg TRANSPORT_VERSION=$TRANSPORT_VERSION \
+ --build-arg RUBY_SOURCE=$RUBY_SOURCE \
+ .
+
+mkdir -p elasticsearch-api/tmp
+
+if [[ "$TEST_SUITE" == "serverless" ]]; then
+ echo "--- :ruby: Running :yaml: tests"
+ docker run \
+ -u "$(id -u)" \
+ --env "TEST_ES_SERVER=${TEST_ES_SERVER}" \
+ --env "ES_API_KEY=${ES_API_SECRET_KEY}" \
+ --env "BUILDKITE=${BUILDKITE}" \
+ --env "TRANSPORT_VERSION=${TRANSPORT_VERSION}" \
+ --env "ES_YAML_TESTS_BRANCH=${ES_YAML_TESTS_BRANCH}" \
+ --env "TEST_SUITE=${TEST_SUITE}" \
+ --env "DEBUG=${DEBUG}" \
+ --env "QUIET=${QUIET}" \
+ --volume $repo:/usr/src/app \
+ --name elasticsearch-ruby \
+ --rm \
+ elastic/elasticsearch-ruby \
+ bundle exec rake test:yaml
+else
+ echo "--- :ruby: Running stack tests"
+ docker run \
+ -u "$(id -u)" \
+ --network="${network_name}" \
+ --env "TEST_ES_SERVER=${elasticsearch_url}" \
+ --env "ELASTIC_PASSWORD=${elastic_password}" \
+ --env "ELASTIC_USER=elastic" \
+ --env "STACK_VERSION=${STACK_VERSION}" \
+ --env "BUILDKITE=${BUILDKITE}" \
+ --env "TRANSPORT_VERSION=${TRANSPORT_VERSION}" \
+ --env "ES_YAML_TESTS_BRANCH=${ES_YAML_TESTS_BRANCH}" \
+ --env "TEST_SUITE=${TEST_SUITE}" \
+ --env "DEBUG=${DEBUG}" \
+ --env "QUIET=${QUIET}" \
+ --volume $repo:/usr/src/app \
+ --name elasticsearch-ruby \
+ --rm \
+ elastic/elasticsearch-ruby \
+ bundle exec rake test:yaml
+fi
diff --git a/.github/create_jenkins_job.rb b/.github/create_jenkins_job.rb
deleted file mode 100644
index 735d3b9dcf..0000000000
--- a/.github/create_jenkins_job.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-source_branch = ARGV[0]
-target_branch = ARGV[1]
-
-def usage
- <<~USAGE
-
- This script creates a new Jenkins Job in .ci/jobs. It takes two parameters:
- - source branch: branch name for the job to use as a source
- - target branch: branch name for the new job
- In the new file, it is going to replace the source branch value with the target branch value and
- create a new yml file based on that.
-
- E.g.:
- $ #{__FILE__} 7.x 7.99
- This is going to use .ci/jobs/elastic+elasticsearch-ruby+7.x.yml as a source and create
- .ci/jobs/elastic+elasticsearch-ruby+7.99.yml and replace all the ocurrences of '7.x' with '7.99'
- in the new file.
- USAGE
-end
-
-unless source_branch && target_branch
- puts usage
- exit
-end
-
-job_file = File.expand_path("../.ci/jobs/elastic+elasticsearch-ruby+#{source_branch}.yml", __dir__)
-raise ArgumentError, "cannot find file #{job_file}" unless File.exist? job_file
-
-target_branch_file = File.expand_path("../.ci/jobs/elastic+elasticsearch-ruby+#{target_branch}.yml", __dir__)
-target_branch_content = File.read(job_file).gsub(source_branch, target_branch)
-
-begin
- File.open(target_branch_file, 'w') { |file| file.puts target_branch_content }
-rescue StandardError => e
- raise e
-end
diff --git a/.ci/make.sh b/.github/make.sh
similarity index 78%
rename from .ci/make.sh
rename to .github/make.sh
index 9ec3e82f25..b36c4cea5b 100755
--- a/.ci/make.sh
+++ b/.github/make.sh
@@ -3,7 +3,7 @@
#
# Build entry script for elasticsearch-ruby
#
-# Must be called: ./.ci/make.sh
+# Must be called: ./.github/make.sh
#
# Version: 1.1.0
#
@@ -34,34 +34,23 @@ STACK_VERSION=$VERSION
set -euo pipefail
product="elastic/elasticsearch-ruby"
-output_folder=".ci/output"
-codegen_folder=".ci/output"
-OUTPUT_DIR="$repo/${output_folder}"
-REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
-RUBY_VERSION=${RUBY_VERSION-3.1}
+RUBY_VERSION=${RUBY_VERSION-3.3}
WORKFLOW=${WORKFLOW-staging}
-mkdir -p "$OUTPUT_DIR"
echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
-echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m"
echo -e "\033[34;1mINFO:\033[0m RUBY_VERSION ${RUBY_VERSION}\033[0m"
case $CMD in
clean)
echo -e "\033[36;1mTARGET: clean workspace $output_folder\033[0m"
- rm -rf "$output_folder"
+ rm -rf "/build"
echo -e "\033[32;1mdone.\033[0m"
exit 0
;;
assemble)
- if [ -v $VERSION ]; then
- echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m"
- exit 1
- fi
- echo -e "\033[36;1mTARGET: assemble artefact $VERSION\033[0m"
- TASK=assemble
- TASK_ARGS=("$VERSION" "$output_folder")
+ echo -e "\033[36;1mTARGET: assemble\033[0m"
+ TASK=build_gems
;;
codegen)
TASK=codegen
@@ -74,13 +63,10 @@ case $CMD in
fi
echo -e "\033[36;1mTARGET: generate docs for $VERSION\033[0m"
TASK=codegen
- # VERSION is BRANCH here for now
- TASK_ARGS=("$VERSION" "$codegen_folder")
;;
examplesgen)
echo -e "\033[36;1mTARGET: generate docs examples\033[0m"
TASK='docs:generate'
- # VERSION is BRANCH here for now
TASK_ARGS=()
;;
bump)
@@ -134,8 +120,6 @@ docker build --no-cache --build-arg BUILDER_UID="$(id -u)" --file .buildkite/Doc
echo -e "\033[34;1mINFO: running $product container\033[0m"
-mkdir -p "$OUTPUT_DIR"
-
# Convert ARGS to comma separated string for Rake:
args_string="${TASK_ARGS[*]}"
args_string="${args_string// /,}"
@@ -144,26 +128,16 @@ docker run \
-u "$(id -u)" \
--env "RUBY_VERSION=${RUBY_VERSION}" \
--env "WORKFLOW=${WORKFLOW}" \
+ --env "CLIENTS_GITHUB_TOKEN=${CLIENTS_GITHUB_TOKEN}" \
--name test-runner \
- --volume "${REPO_BINDING}" \
--volume "${repo}:/usr/src/app" \
--rm \
"${product}" \
- bundle exec rake unified_release:${TASK}["${args_string}"]
+ bundle exec rake automation:${TASK}["${args_string}"]
# ------------------------------------------------------- #
# Post Command tasks & checks
# ------------------------------------------------------- #
-
-if [[ "$CMD" == "assemble" ]]; then
- if compgen -G ".ci/output" > /dev/null; then
- echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m"
- else
- echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m"
- exit 1
- fi
-fi
-
if [[ "$CMD" == "docsgen" ]]; then
echo "TODO"
fi
diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml
new file mode 100644
index 0000000000..bb466166d0
--- /dev/null
+++ b/.github/workflows/docs-build.yml
@@ -0,0 +1,19 @@
+name: docs-build
+
+on:
+ push:
+ branches:
+ - main
+ pull_request_target: ~
+ merge_group: ~
+
+jobs:
+ docs-preview:
+ uses: elastic/docs-builder/.github/workflows/preview-build.yml@main
+ with:
+ path-pattern: docs/**
+ permissions:
+ deployments: write
+ id-token: write
+ contents: read
+ pull-requests: read
diff --git a/.github/workflows/docs-cleanup.yml b/.github/workflows/docs-cleanup.yml
new file mode 100644
index 0000000000..f83e017b5f
--- /dev/null
+++ b/.github/workflows/docs-cleanup.yml
@@ -0,0 +1,14 @@
+name: docs-cleanup
+
+on:
+ pull_request_target:
+ types:
+ - closed
+
+jobs:
+ docs-preview:
+ uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main
+ permissions:
+ contents: none
+ id-token: write
+ deployments: write
diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml
index d7357e56e7..e556b833ee 100644
--- a/.github/workflows/license.yml
+++ b/.github/workflows/license.yml
@@ -4,10 +4,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
- ruby-version: 3
+ ruby-version: '3.4'
- name: Check license headers
run: |
ruby ./.github/check_license_headers.rb
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 428a03e7e9..b1d5d5a65f 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -14,10 +14,10 @@ jobs:
strategy:
fail-fast: false
matrix:
- ruby: [ '3.0', '3.1', '3.2', 'jruby-9.3', 'jruby-9.4' ]
+ ruby: ['head', '3.2', '3.3', '3.4', 'jruby-9.3', 'jruby-9.4', 'jruby-head']
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Increase system limits
run: |
sudo swapoff -a
@@ -26,8 +26,7 @@ jobs:
sudo sysctl -w vm.max_map_count=262144
- uses: elastic/elastic-github-actions/elasticsearch@master
with:
- stack-version: 8.10.0-SNAPSHOT
- security-enabled: false
+ stack-version: 9.1.0-SNAPSHOT
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
@@ -40,4 +39,4 @@ jobs:
- name: elasticsearch
run: cd elasticsearch && bundle exec rake test:all
- name: elasticsearch-api
- run: cd elasticsearch-api && bundle exec rake test:spec test:platinum:unit
+ run: rake es:download_artifacts[9.1.0-SNAPSHOT] && cd elasticsearch-api && bundle exec rake test:all
diff --git a/.github/workflows/otel.yml b/.github/workflows/otel.yml
new file mode 100644
index 0000000000..b7bca6a485
--- /dev/null
+++ b/.github/workflows/otel.yml
@@ -0,0 +1,44 @@
+name: opentelemetry
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+jobs:
+ test-otel:
+ name: 'Test Open Telemetry'
+ env:
+ TEST_ES_SERVER: http://localhost:9250
+ PORT: 9250
+ TEST_WITH_OTEL: true
+ strategy:
+ fail-fast: false
+ matrix:
+ ruby: ['3.4', 'jruby-9.4']
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Increase system limits
+ run: |
+ sudo swapoff -a
+ sudo sysctl -w vm.swappiness=1
+ sudo sysctl -w fs.file-max=262144
+ sudo sysctl -w vm.max_map_count=262144
+ - uses: elastic/elastic-github-actions/elasticsearch@master
+ with:
+ stack-version: 9.1.0-SNAPSHOT
+ - uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ - name: Build
+ run: |
+ sudo apt-get update
+ sudo apt-get install libcurl4-openssl-dev
+ rake bundle:clean
+ rake bundle:install
+ - name: elasticsearch
+ run: cd elasticsearch && bundle exec rake test:all
+ - name: elasticsearch-api
+ run: rake es:download_artifacts[9.1.0-SNAPSHOT] && cd elasticsearch-api && bundle exec rake test:all
diff --git a/.github/workflows/unified-release.yml b/.github/workflows/unified-release.yml
deleted file mode 100644
index 75de2ec33c..0000000000
--- a/.github/workflows/unified-release.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: Unified Release
-
-on:
- pull_request:
- paths-ignore:
- - 'README.md'
- push:
- paths-ignore:
- - 'README.md'
- branches:
- - main
- - master
- - '[0-9]+.[0-9]+'
- - '[0-9]+.x'
-
-jobs:
- assemble:
- name: Assemble
- runs-on: ubuntu-latest
- env:
- stack-version: 8.10.0-SNAPSHOT
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Assemble ${{ env.STACK_VERSION }}
- run: "./.ci/make.sh assemble ${{ env.stack-version }}"
diff --git a/.gitignore b/.gitignore
index 8227873292..b6ec5bd32e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,4 +14,7 @@ Gemfile.lock
profile/**/data/*.json
.ci/output
parsed_alternative_report.json
-.byebug_history
\ No newline at end of file
+.byebug_history
+build/
+*.gem
+elastic-client-generator-ruby
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ffac783793..ac3416994b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,380 @@
-*To see release notes for the `7.x` branch and older releases, see [CHANGELOG on the 7.17 branch](https://github.com/elastic/elasticsearch-ruby/blob/7.17/CHANGELOG.md).*
+*See the full release notes on the official documentation website: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/release_notes.html*
+
+## 8.17.0 Release notes
+
+### Client
+* Tested versions of Ruby for 8.17.0: Ruby (MRI) 3.1, 3.2 and 3.3. JRuby 9.3 and JRuby 9.4.
+
+### API
+
+#### API changes
+* `async_search.submit` - Removes `keep_alive` parameter. Adds:
+ * `ccs_minimize_roundtrips` (Boolean): When doing a cross-cluster search, setting it to true may improve overall search latency, particularly when searching clusters with a large number of shards. However, when set to true, the progress of searches on the remote clusters will not be received until the search finishes on all clusters.
+ * `rest_total_hits_as_int` (Boolean): Indicates whether hits.total should be rendered as an integer or an object in the rest search response.
+* `open_point_in_time` - Adds `allow_partial_search_results` (Boolean) parameter: Specify whether to tolerate shards missing when creating the point-in-time, or otherwise throw an exception (default: false).
+
+
+## 8.16.0 Release notes
+
+### Client
+* Tested versions of Ruby for 8.16.0: Ruby (MRI) 3.1, 3.2 and 3.3. JRuby 9.3 and JRuby 9.4.
+
+### API
+
+#### API changes
+
+* `capabilities` - Adds `local_only` boolean parameter: True if only the node being called should be considered.
+* `cluster.stats`- Removes `flat_settings` parameter, adds `include_remotes` boolean parameter: Include remote cluster data into the response (default: false)
+* `indices.get_data_stream` - Adds `verbose` boolean parameter: Whether the maximum timestamp for each data stream should be calculated and returned (default: false). Adds `master_timeout` (see below).
+* `query_rules.delete_ruleset` - Accepts `ignore: 404` common parameter.
+
+##### Timeout parameters:
+
+These parameters have been added to several APIs:
+
+* `master_timeout` timeout for processing on master node.
+* `timeout` timeout for acknowledgement of update from all nodes in cluster parameters.
+
+Added in:
+
+* `indices.create_data_stream` - both.
+* `indices.delete_data_stream` - `master_timeout`.
+* `indices.get_data_lifecycle` - `master_timeout`.
+* `indices.get_data_stream` - `master_timeout`.
+* `indices.migrate_to_data_stream` - both.
+* `indices.promote_data_stream` - `master_timeout`.
+* `search_shards` - `master_timeout`.
+
+#### APIs Promoted from Experimental to Stable:
+
+* `indices.delete_data_lifecycle`
+* `indices.explain_data_lifecycle`
+* `indices.get_data_lifecycle`
+* `indices.put_data_lifecycle`
+* `security.create_cross_cluster_api_key`
+* `security.update_cross_cluster_api_key`
+
+#### New APIs
+
+* `ingest.delete_ip_location_database` - Deletes an ip location database configuration.
+* `ingest.get_ip_location_database` - Returns the specified ip location database configuration.
+* `ingest.put_ip_location_database` - Puts the configuration for a ip location database to be downloaded.
+
+
+#### New Experimental APIs
+
+* `inference.stream_inference` - Perform streaming inference.
+* `query_rules.test` - Tests a query ruleset to identify the rules that would match input criteria.
+
+
+## 8.15.0 Release notes
+
+### Client
+* Tested versions of Ruby for 8.15.0: Ruby (MRI) 3.0, 3.1, 3.2 and 3.3. JRuby 9.3 and JRuby 9.4.
+
+#### API changes
+
+* `snapshot.delete` - Adds `wait_for_completion` Boolean parameter, should this request wait until the operation has completed before returning.
+* `cluster.allocation_explain` - `body` is no longer a required parameter.
+* `connector.put` - (experimental API) `body` and `connector_id` no longer required parameters.
+* `machine_learning.update_trained_model_deployment` has been promoted to stable from Beta. Adds Integer parameter `number_of_allocations`, updates the model deployment to this number of allocations.
+
+##### `master_timeout` and `timeout` parameters
+
+These parameters have been added to several APIs:
+
+* `master_timeout` timeout for processing on master node.
+* `timeout` timeout for acknowledgement of update from all nodes in cluster parameters.
+
+The APIs:
+
+* `autoscaling.delete_autoscaling_policy` - both.
+* `autoscaling.get_autoscaling_capacity`- `master_timeout`.
+* `get_autoscaling_policy` - `master_timeout`.
+* `put_autoscaling_policy` - both.
+* `enrich.delete_policy` - `master_timeout`.
+* `enrich.execute_policy` - `master_timeout`.
+* `enrich.get_policy` - `master_timeout`.
+* `enrich.put_policy` - `master_timeout`.
+* `enrich.stats` - `master_timeout`.
+* `features.reset_features` - `master_timeout`.
+* `license.delete` - both.
+* `license.post` - both.
+* `license.post_start_basic` - both.
+* `license.post_start_trial` - both.
+* `security.get_settings` - `master_timeout`.
+* `security.update_settings` - both.
+* `shutdown.get_node` - `master_timeout`.
+* `snapshot_lifecycle_management.start` - both.
+* `snapshot_lifecycle_management.stop` - both.
+* `watcher.get_settings` - `master_timeout`.
+* `watcher.start` - `master_timeout`.
+* `watcher.stop` - `master_timeout`.
+* `watcher.update_settings` - both.
+
+##### Inference APIs have been renamed:
+
+* `inference.delete_model` => `inference.delete`. Also adds two new parameters:
+ * `dry_run` (Boolean), if true the endpoint will not be deleted and a list of ingest processors which reference this endpoint will be returned.
+ * `force` (Boolean), if true the endpoint will be forcefully stopped (regardless of whether or not it is referenced by any ingest processors or semantic text fields).
+* `inference.get_model` => `inference.get`
+* `inference.put_model` => `inference.put`
+
+##### Query Rules parameters consolidated
+
+Changes in `query_ruleset` and `query_rules` APIs, these have been combined into the `query_rules` namespace:
+
+* `query_rules.delete_ruleset` - Renamed from `query_ruleset.delete`, promoted from experimental to stable.
+* `query_rules.delete_rule` - Deletes an individual query rule within a ruleset.
+* `query_rules.get_rule` - Returns the details about an individual query rule within a ruleset.
+* `query_rules.get_ruleset` - Renamed from `query_ruleset.get`, promoted from experimental to stable.
+* `query_rules.list_rulesets` - Renamed from `query_ruleset.list`, promoted from experimental to stable.
+* `query_rules.put_rule` - Creates or updates a query rule within a ruleset.
+* `query_rules.put_ruleset` - Renamed from `query_ruleset.put_ruleset`, promoted from experimental to stable.
+
+#### New APIs:
+
+* `ingest.delete_geoip_database` - Deletes a geoip database configuration.
+* `ingest.get_geoip_database` - Returns geoip database configuration.
+* `ingest.put_geoip_database` - Puts the configuration for a geoip database to be downloaded.
+* `security.bulk_delete_role` - Bulk delete roles in the native realm.
+* `security.bulk_put_role` - Bulk adds and updates roles in the native realm.
+* `security.query_role` - Retrieves information for Roles using a subset of query DSL.
+* `transform.get_node_stats` - Retrieves transform usage information for transform nodes.
+
+#### New Experimental APIs:
+
+* `connector.sync_job_claim` - Claims a connector sync job.
+* `connector.update_features` - Updates the connector features in the connector document.
+
+### Development
+
+- Added a build using [es-test-runner-ruby](https://github.com/elastic/es-test-runner-ruby) and [Elasticsearch Clients Tests](https://github.com/elastic/elasticsearch-clients-tests) which will replace the Elasticsearch YAML test runner.
+
+## 8.14.0 Release notes
+
+### Client
+* Tested versions of Ruby for 8.14.0: Ruby (MRI) 3.0, 3.1, 3.2 and 3.3. JRuby 9.3 and JRuby 9.4.
+
+### API
+
+API changes:
+
+- All Connector APIs have been migrated to one common namespace `connector`:
+ - `connector_secret.delete` -> `connector.secret_delete`
+ - `connector_secret.get` -> `connector.secret_get`
+ - `connector_secret.post` -> `connector.secret_post`
+ - `connector_secret.put` -> `connector.secret_put`
+ - `connector_sync_job.cancel` -> `connector.sync_job_cancel`
+ - `connector_sync_job.check_in` -> `connector.sync_job_check_in`
+ - `connector_sync_job.delete` -> `connector.sync_job_delete`
+ - `connector_sync_job.error` -> `connector.sync_job_error`
+ - `connector_sync_job.get` -> `connector.sync_job_get`
+ - `connector_sync_job.post` -> `connector.sync_job_post`
+ - `connector_sync_job.update_stats` -> `connector.sync_job_update_stats`
+
+- `connector.delete` - Adds Boolean parameter `:delete_sync_jobs`: Determines whether associated sync jobs are also deleted.
+- `cross_cluster_replication.delete_auto_follow_pattern`, `cross_cluster_replication.follow`, `cross_cluster_replication.follow_info`, `cross_cluster_replication.get_auto_follow_pattern`, `cross_cluster_replication.pause_auto_follow_pattern`, `cross_cluster_replication.pause_follow`, `cross_cluster_replication.put_auto_follow_pattern`, `cross_cluster_replication.resume_auto_follow_pattern`, `cross_cluster_replication.resume_follow`, `cross_cluster_replication.stats`, `cross_cluster_replication.unfollow` - Add Time parameter `:master_timeout`: Explicit operation timeout for connection to master node.
+- `cross_cluster_replication.follow_stats`, `cross_cluster_replication.forget_follower`, `cross_cluster_replication.stats` - Add Time parameter `:timeout`: Explicit operation timeout.
+- `indices/rollover` - Adds Boolean parameter `:target_failure` If set to true, the rollover action will be applied on the failure store of the data stream.
+- `inference.get_model` - Parameter `inference_id` no longer required.
+- `search_application.search` - Adds Boolean parameter `:typed_keys`: Specify whether aggregation and suggester names should be prefixed by their respective types in the response.
+- `security.get_api_key`, `security.query_api_keys` - Add Boolean parameter `:with_profile_uid`: flag to also retrieve the API Key's owner profile uid, if it exists.
+
+New APIs:
+
+- `profiling.topn_functions` - Extracts a list of topN functions from Universal Profiling.
+- `text_structure.find_field_structure` - Finds the structure of a text field in an index.
+- `text_structure/find_message_structure`- Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch.
+
+APIs Migrated from experimental to stable:
+
+- `esql.async_query`
+- `esql.query`
+
+New Experimental APIs:
+
+- `connector.update_active_filtering` - Activates the draft filtering rules if they are in a validated state.
+- `connector.update_filtering_validation` - Updates the validation info of the draft filtering rules.
+
+## 8.13.0 Release notes
+
+### Client
+* Tested versions of Ruby for 8.13.0: Ruby (MRI) 3.0, 3.1, 3.2 and 3.3. JRuby 9.3 and JRuby 9.4.
+
+### Experimental ES|QL Helper
+
+This version provides a new experimental Helper for the ES|QL `query` API. Please check out [the documentation](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/Helpers.html#esql-helper) and [open an issue](https://github.com/elastic/elasticsearch-ruby/issues/new/choose) if you encounter any problems or have any feedback.
+
+### API
+
+API Changes:
+
+* `async_search.status` - adds Time `:keep_alive` parameter: Specify the time interval in which the results (partial or final) for this search will be available.
+* `bulk` - adds boolean `:require_data_stream` parameter: When true, requires the destination to be a data stream (existing or to-be-created). Default is false.
+* `connector.list` - Adds the following parameters:
+ * `:index_name` (List): A comma-separated list of connector index names to fetch connector documents for.
+ * `:connector_name` (List): A comma-separated list of connector names to fetch connector documents for.
+ * `:service_type` (List): A comma-separated list of connector service types to fetch connector documents for.
+ * `:query` (String): A search string for querying connectors, filtering results by matching against connector names, descriptions, and index names.
+* `esql.query` - adds boolean `:drop_null_columns` parameter: Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section.
+* `field_caps` - Adds `:include_empty_fields` boolean parameter: Include empty fields in result.
+* `index` - adds boolean `:require_data_stream` parameter: When true, requires the destination to be a data stream (existing or to-be-created). Default is false.
+* `indices.rollover` - adds boolean `:lazy` parameter: If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write. Only allowed on data streams.
+* connector_sync_job.list - adds List `:job_type` parameter: A comma-separated list of job types.
+* `inference.delete_model`, `inference.get_model`, `inference.inference`, `inference.put_model`: renames `:model_id` parameter to `:inference_id`.
+* `termvector` will show a warning since it's been deprecated. Please use the plural version, `termvectors`.
+
+New APIs:
+
+* `indices.resolve_cluster` - Resolves the specified index expressions to return information about each cluster, including the local cluster, if included.
+* `profiling.flamegraph` - Extracts a UI-optimized structure to render flamegraphs from Universal Profiling.
+* `profiling.stacktraces` - Extracts raw stacktrace information from Universal Profiling.
+* `security.query_user` - Retrieves information for Users using a subset of query DSL
+* `text_structure.test_grok_pattern` - Tests a Grok pattern on some text.
+
+APIs Migrated from experimental to stable:
+
+* `synonyms.delete_synonym`
+* `synonyms.delete_synonym_rule`
+* `synonyms.get_synonym`
+* `synonyms.get_synonym_rule`
+* `synonyms.get_synonyms_sets`
+* `synonyms.put_synonym`
+* `synonyms.put_synonym_rule`
+
+New Experimental APIs:
+
+* `connector.update_api_key_id` - Updates the API key id and/or API key secret id fields in the connector document.
+* `connector.update_index_name` - Updates the index name of the connector.
+* `connector.update_native` - Updates the is_native flag of the connector.
+* `connector.update_service_type` - Updates the service type of the connector.
+* `connector.update_status` - Updates the status of the connector.
+* `esql.async_query` - Executes an ESQL request asynchronously
+* `esql.async_query_get` - Retrieves the results of a previously submitted async query request given its ID.
+
+New Experimental namespace `connector_secret`:
+
+* `connector_secret.delete` - Deletes a connector secret.
+* `connector_secret.get` - Retrieves a secret stored by Connectors.
+* `connector_secret.post` - Creates a secret for a Connector.
+* `connector_secret.put` - Creates or updates a secret for a Connector.
+
+### Development
+
+* Migrated from `byebug` to `debug`.
+* Added extra testing for OpenTelemetry.
+
+## 8.12.0 Release notes
+
+### Client
+
+* Tested versions of Ruby for 8.12.0: Ruby (MRI) 3.0, 3.1, 3.2 and 3.3. JRuby 9.3 and JRuby 9.4.
+
+### API
+
+API Changes:
+
+* `bulk` - Adds boolean `:list_executed_pipelines` parameter: Sets `list_executed_pipelines` for all incoming documents. Defaults to unset (false).
+* `indices.put_settings` - Adds boolean `:reopen` parameter: Whether to close and reopen the index to apply non-dynamic settings. If set to `true` the indices to which the settings are being applied will be closed temporarily and then reopened in order to apply the changes. The default is `false`.
+* `open_point_in_time` - Adds Hash `:body` parameter: an index_filter specified with the Query DSL.
+* `security.get_api_key` - Adds boolean `:active_only` parameter: flag to limit response to only active (not invalidated or expired) API keys.
+
+#### New APIs
+
+New API for [Universal profiling](https://www.elastic.co/guide/en/observability/8.12/universal-profiling.html):
+
+* `profiling.status` - Returns basic information about the status of Universal Profiling.
+
+
+New experimental API:
+
+* `simulate.ingest` - Simulates running ingest with example documents. See: https://www.elastic.co/guide/en/elasticsearch/reference/8.12/simulate-ingest-api.html
+
+##### Connectors API
+
+Version 8.12 introduces the experimental [Connectors API](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/connector-apis.html). Use the following APIs to manage connectors:
+
+* `connector.post` - Creates a connector. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/create-connector-api.html)
+* `connector.put` - Creates or updates a connector. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/create-connector-api.html)
+* `connector.delete` - Deletes a connector. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-connector-api.html)
+* `connector.get` - Returns the details about a connector. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-connector-api.html)
+* `connector.list` - Lists all connectors. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/list-connector-api.html)
+* `connector.check_in` - Updates the last_seen timestamp in the connector document. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/check-in-connector-api.html)
+* `connector.update_configuration` - Updates the connector configuration. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-connector-configuration-api.html)
+* `connector.update_error` - Updates the error field in the connector document. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-connector-error-api.html)
+* `connector.update_filtering` - Updates the filtering field in the connector document. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-connector-filtering-api.html)
+* `connector.last_sync` - Updates the stats of last sync in the connector document. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-connector-last-sync-api.html)
+* `connector.update_name` - Updates the name and/or description fields in the connector document. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-connector-name-description-api.html)
+* `connector.update_pipeline` - Updates the pipeline field in the connector document. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-connector-pipeline-api.html)
+* `connector.update_scheduling` - Updates the scheduling field in the connector document. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/update-connector-scheduling-api.html)
+
+Use the following APIs to manage sync jobs:
+
+* `connector_sync_job.cancel` - Cancels a connector sync job. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/cancel-connector-sync-job-api.html)
+* `connector_sync_job.check_in` - Checks in a connector sync job (refreshes 'last_seen'). See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/check-in-connector-sync-job-api.html)
+* `connector_sync_job.delete` - Deletes a connector sync job. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/delete-connector-sync-job-api.html)
+* `connector_sync_job.error` - Sets an error for a connector sync job. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/set-connector-sync-job-error-api.html)
+* `connector_sync_job.get` - Returns the details about a connector sync job. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-connector-sync-job-api.html)
+* `connector_sync_job.list` - Lists all connector sync jobs. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/list-connector-sync-jobs-api.html)
+* `connector_sync_job.post` - Creates a connector sync job. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/create-connector-sync-job-api.html)
+* `connector_sync_job.update_stats` - Updates the stats fields in the connector sync job document. See [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/set-connector-sync-job-stats-api.html)
+
+
+
+## 8.11.0 Release notes
+
+### Client
+
+* Tested versions of Ruby for 8.11.0: Ruby (MRI) 3.0, 3.1 and 3.2. JRuby 9.3 and JRuby 9.4.
+* Adds native support for *Open Telemetry*. See Open Telemetry for documentation.
+* Improved documentation, now you can find more examples in Ruby in the [REST API reference](https://www.elastic.co/guide/en/elasticsearch/reference/8.11/rest-apis.html).
+
+### API
+
+New Experimental APIs:
+- `esql.query` - Executes an ESQL request.
+- `inference.delete_model` - Delete model in the Inference API.
+- `inference.get_model` - Get a model in the Inference API.
+- `inference.inference` - Perform inference on a model.
+- `inference.put_model` - Configure a model for use in the Inference API.
+
+## 8.10.0 Release notes
+
+### Client
+* Tested versions of Ruby for 8.10.0: Ruby (MRI) 3.0, 3.1 and 3.2. JRuby 9.3 and JRuby 9.4.
+
+### API
+
+#### New Experimental APIs, for internal use:
+- `fleet.delete_secret`
+- `fleet.get_secret`
+- `fleet.post_secret`
+
+#### New stable APIs:
+- `security.get_settings` - Retrieve settings for the security system indices
+- `security.update_settings` - Update settings for the security system indices
+
+#### New Experimental API:
+- `query_ruleset.list` List query rulesets.
+
+#### API Changes:
+- `indices.reload_search_analyzers` - Adds parameter `resource` changed resource to reload analyzers from if applicable
+
+Promoted from Experimental to Beta:
+- `security.create_cross_cluster_api_key`
+- `security.update_cross_cluster_api_key`
+
+#### Synonyms namespace update:
+
+All synonym related APIs have been moved to the `synonyms` namespace and some of the endpoints have been renamed, as well as their parameters:
+- `synonyms.delete` => `synonyms.delete_synonym` - requires `id`, the id of the synonyms set to be deleted.
+- `synonyms.get` => `synonyms.get_synonym` - requires `id`, the name of the synonyms set to be retrieved.
+- `synonyms_set.get_synonyms_sets` => `synonyms.get_synonyms_sets`
+- `synonyms.put` => `synonyms.put_synonym` - requires `id` of the synonyms set to be created or updated.
+- `synonym_rule.put` => `synonyms.put_synonym_rule` - Parameters changed to `set_id` (the id of the synonym set to be updated with the synonym rule) and `rule_id` (the id of the synonym rule to be updated or created).
+- New Experimental API `synonyms.delete_synonym_rule` - Deletes a synonym rule in a synonym set
+- New Experimental API `synonyms.get_synonym_rule` - Retrieves a synonym rule from a synonym set
## 8.9.0 Release notes
diff --git a/Gemfile b/Gemfile
index f8150c9b0c..a2263210df 100644
--- a/Gemfile
+++ b/Gemfile
@@ -25,7 +25,6 @@ gem 'cane'
gem 'mocha'
gem 'pry'
gem 'rake'
-gem 'rubocop'
gem 'shoulda-context'
gem 'simplecov'
gem 'test-unit', '~> 2'
@@ -37,6 +36,7 @@ unless defined?(JRUBY_VERSION) || defined?(Rubinius)
end
group :development, :test do
- gem 'byebug'
+ gem 'debug' unless defined?(JRUBY_VERSION)
gem 'rspec'
+ gem 'rubocop', '>= 1.51' unless defined?(JRUBY_VERSION)
end
diff --git a/README.md b/README.md
index 3d0ed0755f..939ecf6e0a 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,10 @@
# Elasticsearch
-[](https://github.com/elastic/elasticsearch-ruby/actions/workflows/7.17.yml) [](https://github.com/elastic/elasticsearch-ruby/actions/workflows/8.7.yml) [](https://github.com/elastic/elasticsearch-ruby/actions/workflows/8.8.yml) [](https://github.com/elastic/elasticsearch-ruby/actions/workflows/8.9.yml) [](https://github.com/elastic/elasticsearch-ruby/actions/workflows/main.yml) [](https://buildkite.com/elastic/elasticsearch-ruby)
+[](https://github.com/elastic/elasticsearch-ruby/actions/workflows/8.17.yml) [](https://github.com/elastic/elasticsearch-ruby/actions/workflows/8.18.yml) [](https://github.com/elastic/elasticsearch-ruby/actions/workflows/9.0.yml) [](https://github.com/elastic/elasticsearch-ruby/actions/workflows/main.yml) [](https://buildkite.com/elastic/elasticsearch-ruby)
+
+**[Download the latest version of Elasticsearch](https://www.elastic.co/downloads/elasticsearch)**
+or
+**[sign-up](https://cloud.elastic.co/registration?elektra=en-ess-sign-up-page)**
+**for a free trial of Elastic Cloud**.
This repository contains the official [Elasticsearch](https://www.elastic.co/products/elasticsearch) Ruby client. The [`elasticsearch`](https://github.com/elasticsearch/elasticsearch-ruby/tree/main/elasticsearch) gem is a complete Elasticsearch client which uses two separate libraries:
@@ -67,7 +72,28 @@ Please see their respective READMEs for information and documentation.
We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/).
-Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch. Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
+Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch without breaking.
+It does not mean that the client automatically supports new features of newer Elasticsearch versions; it is only possible after a release of a new client version.
+For example, a 8.12 client version won't automatically support the new features of the 8.13 version of Elasticsearch, the 8.13 client version is required for that.
+Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.
+
+| Gem Version | | Elasticsearch Version | Supported |
+|-------------|---|------------------------|-----------|
+| 8.x | → | 8.x | 8.x |
+| 9.x | → | 9.x | 9.x |
+| main | → | main | |
+
+## Try Elasticsearch and Kibana locally
+
+If you want to try Elasticsearch and Kibana locally, you can run the following command:
+
+```bash
+curl -fsSL https://elastic.co/start-local | sh
+```
+
+This will run Elasticsearch at http://localhost:9200 and Kibana at http://localhost:5601 using Docker.
+
+More information is available [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/run-elasticsearch-locally.html).
## Development
diff --git a/Rakefile b/Rakefile
index a372b3c4d4..62a6205a2b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -38,9 +38,9 @@ def admin_client
}
)
- url = "https://#{user}:#{password}@#{uri.host}:#{uri.port}"
+ url = "https://#{user}:#{password}@#{uri.host}:#{uri.port}"
else
- url = "http://#{user}:#{password}@#{uri.host}:#{uri.port}"
+ url = "http://#{user}:#{password}@#{uri.host}:#{uri.port}"
end
puts "Elasticsearch Client url: #{url}"
Elasticsearch::Client.new(host: url, transport_options: transport_options)
@@ -51,8 +51,6 @@ import 'rake_tasks/elasticsearch_tasks.rake'
import 'rake_tasks/test_tasks.rake'
import 'rake_tasks/doc_generator.rake'
import 'rake_tasks/docker_tasks.rake'
-import 'rake_tasks/update_version.rake'
-import 'profile/benchmarking/benchmarking_tasks.rake'
require 'pathname'
CURRENT_PATH = Pathname(File.expand_path(__dir__))
@@ -70,7 +68,7 @@ RELEASE_TOGETHER = [
CERT_DIR = ENV['CERT_DIR'] || '.ci/certs'
# Import build task after setting constants:
-import 'rake_tasks/unified_release_tasks.rake'
+import 'rake_tasks/automation.rake'
# TODO: Figure out "bundle exec or not"
# subprojects.each { |project| $LOAD_PATH.unshift CURRENT_PATH.join(project, "lib").to_s }
@@ -131,3 +129,12 @@ task :release do
puts '-' * 80
end
end
+
+desc 'Server info'
+task :info do
+ require 'elasticsearch'
+
+ client = Elasticsearch::Client.new(url: ENV['TEST_ES_SERVER'], api_key: ENV['ES_API_KEY'])
+ info = client.info
+ puts "Connected to Elasticsearch cluster #{info['cluster_name']}"
+end
diff --git a/benchmarks/Dockerfile b/benchmarks/Dockerfile
deleted file mode 100644
index fb148f89d2..0000000000
--- a/benchmarks/Dockerfile
+++ /dev/null
@@ -1,20 +0,0 @@
-# $ docker build --file benchmarks/Dockerfile --tag elastic/elasticsearch-ruby .
-
-ARG RUBY_VERSION=2.7
-FROM ruby:${RUBY_VERSION}
-
-ENV TERM xterm-256color
-ENV GEM_HOME="/usr/local/bundle"
-ENV PATH $GEM_HOME/bin:$GEM_HOME/gems/bin:$PATH
-
-VOLUME ["/data"]
-
-WORKDIR /elasticsearch-ruby
-
-# TODO(karmi): Copy dependencies first to make use of Docker layer caching
-COPY . .
-
-RUN bundle install --retry=5
-RUN cd benchmarks && bundle install
-
-CMD ["/bin/bash"]
diff --git a/benchmarks/Gemfile b/benchmarks/Gemfile
deleted file mode 100644
index 45b087784b..0000000000
--- a/benchmarks/Gemfile
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# frozen_string_literal: true
-
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-gem 'elasticsearch', path: File.expand_path('../../elasticsearch', __FILE__), require: false
-gem 'elasticsearch-api', path: File.expand_path('../../elasticsearch-api', __FILE__), require: false
-gem 'elasticsearch-transport', path: File.expand_path('../../elasticsearch-transport', __FILE__), require: false
-
-gem 'ansi'
-gem 'patron'
-gem 'oj'
-
-gem 'pry', group: :development
diff --git a/benchmarks/actions/001_ping.rb b/benchmarks/actions/001_ping.rb
deleted file mode 100644
index d7ea49a855..0000000000
--- a/benchmarks/actions/001_ping.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require_relative '../lib/benchmarks'
-
-Benchmarks.register \
- action: 'ping',
- category: 'core',
- warmups: Benchmarks::DEFAULT_WARMUPS,
- repetitions: 10_000,
- measure: Proc.new { |n, runner|
- runner.runner_client.ping
- }
diff --git a/benchmarks/actions/002_info.rb b/benchmarks/actions/002_info.rb
deleted file mode 100644
index 1b095ab02e..0000000000
--- a/benchmarks/actions/002_info.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-require_relative '../lib/benchmarks'
-
-Benchmarks.register \
- action: 'info',
- category: 'core',
- warmups: Benchmarks::DEFAULT_WARMUPS,
- repetitions: 10_000,
- measure: Proc.new { |n, runner|
- runner.runner_client.info
- }
diff --git a/benchmarks/actions/003_get.rb b/benchmarks/actions/003_get.rb
deleted file mode 100644
index dd612e77ed..0000000000
--- a/benchmarks/actions/003_get.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require_relative '../lib/benchmarks'
-
-Benchmarks.register \
- action: 'get',
- category: 'core',
- warmups: 100,
- repetitions: 10_000,
- setup: Proc.new { |runner|
- runner.runner_client.indices.delete(index: 'test-bench-get', ignore: 404)
- runner.runner_client.index index: 'test-bench-get', id: '1', body: { title: 'Test' }
- runner.runner_client.cluster.health(wait_for_status: 'yellow')
- runner.runner_client.indices.refresh index: 'test-bench-get'
- },
- measure: Proc.new { |n, runner|
- response = runner.runner_client.get index: 'test-bench-get', id: '1'
- raise RuntimeError.new("Incorrect data: #{response}") unless response["_source"]["title"] == "Test"
- }
diff --git a/benchmarks/actions/004_index.rb b/benchmarks/actions/004_index.rb
deleted file mode 100644
index 5428228787..0000000000
--- a/benchmarks/actions/004_index.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require_relative '../lib/benchmarks'
-
-Benchmarks.register \
- action: 'index',
- category: 'core',
- warmups: 100,
- repetitions: 10_000,
- setup: Proc.new { |runner|
- runner.runner_client.indices.delete(index: 'test-bench-index', ignore: 404)
- runner.runner_client.indices.create(index: 'test-bench-index')
- runner.runner_client.cluster.health(wait_for_status: 'yellow')
- },
- measure: Proc.new { |n, runner|
- doc_path = Benchmarks.data_path.join('small/document.json')
- raise RuntimeError.new("Document at #{doc_path} not found") unless doc_path.exist?
- response = runner.runner_client.index index: 'test-bench-index', id: "%04d-%04d" % [n, rand(1..1000)], body: doc_path.open.read
- raise RuntimeError.new("Incorrect response: #{response}") unless response["result"] == "created"
- }
diff --git a/benchmarks/actions/005_bulk.rb b/benchmarks/actions/005_bulk.rb
deleted file mode 100644
index 03213e7a1a..0000000000
--- a/benchmarks/actions/005_bulk.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require_relative '../lib/benchmarks'
-
-Benchmarks.register \
- action: 'bulk',
- category: 'core',
- warmups: 10,
- repetitions: 1_000,
- operations: 10_000,
- setup: Proc.new { |runner|
- runner.runner_client.indices.delete(index: 'test-bench-bulk', ignore: 404)
- runner.runner_client.indices.create(index: 'test-bench-bulk', body: '{"settings": { "number_of_shards": 3, "refresh_interval":"5s"}}')
- runner.runner_client.cluster.health(wait_for_status: 'yellow')
- },
- measure: Proc.new { |n, runner|
- doc_path = Benchmarks.data_path.join('small/document.json')
- raise RuntimeError.new("Document at #{doc_path} not found") unless doc_path.exist?
- doc_body = doc_path.open.read.tr("\n", "").gsub(/\s{2,}/, "") + "\n"
-
- op_meta = %Q|{"index":{}}\n|.freeze
- op_body = ''
-
- 1.upto(runner.operations).each do |i|
- op_body << op_meta
- op_body << doc_body
- end
-
- response = runner.runner_client.bulk index: 'test-bench-bulk', body: op_body
- raise RuntimeError.new("Incorrect response: #{response}") if response["errors"]
- }
diff --git a/benchmarks/bin/run.rb b/benchmarks/bin/run.rb
deleted file mode 100755
index 52866fb139..0000000000
--- a/benchmarks/bin/run.rb
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/usr/bin/env ruby
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-require 'ansi/core'
-require 'logger'
-require 'patron'
-require 'pathname'
-require 'oj'
-
-require_relative '../lib/benchmarks'
-
-puts "Running benchmarks for elasticsearch-ruby@#{Elasticsearch::VERSION}".ansi(:bold,:underline)
-
-config = {
- "ELASTICSEARCH_TARGET_URL" => "",
- "ELASTICSEARCH_REPORT_URL" => "",
- "DATA_SOURCE" => "",
- "BUILD_ID" => "",
- "TARGET_SERVICE_TYPE" => "",
- "TARGET_SERVICE_NAME" => "",
- "TARGET_SERVICE_VERSION" => "",
- "TARGET_SERVICE_OS_FAMILY" => "",
- "CLIENT_BRANCH" => "",
- "CLIENT_COMMIT" => "",
- "CLIENT_BENCHMARK_ENVIRONMENT" => ""
-}
-
-missing_keys = []
-
-config.keys.each do |key|
- if ENV[key] && !ENV[key].to_s.empty?
- config[key] = ENV[key]
- else
- missing_keys << key
- end
-end
-
-unless missing_keys.empty?
-puts "ERROR: Required environment variables [#{missing_keys.join(',')}] missing".ansi(:bold, :red)
- exit(1)
-end
-
-start = Time.now.utc
-
-runner_client = Elasticsearch::Client.new(url: config["ELASTICSEARCH_TARGET_URL"])
-report_client = Elasticsearch::Client.new(
- url: config["ELASTICSEARCH_REPORT_URL"],
- request_timeout: 5*60,
- retry_on_failure: 10
-)
-if ENV['DEBUG']
- logger = Logger.new(STDOUT)
- logger.level = Logger::INFO
- logger.formatter = proc { |s, d, p, m| "#{m}\n".ansi(:faint) }
-
- runner_client.transport.logger = logger
- report_client.transport.logger = logger
-end
-
-runner = Benchmarks::Runner::Runner.new \
- build_id: config['BUILD_ID'],
- environment: config['CLIENT_BENCHMARK_ENVIRONMENT'],
- category: ENV['CLIENT_BENCHMARK_CATEGORY'].to_s,
- runner_client: runner_client,
- report_client: report_client,
- target: {
- service: {
- type: config['TARGET_SERVICE_TYPE'],
- name: config['TARGET_SERVICE_NAME'],
- version: config['TARGET_SERVICE_VERSION'],
- git: {
- branch: ENV['TARGET_SERVICE_GIT_BRANCH'],
- commit: ENV['TARGET_SERVICE_GIT_COMMIT']
- }
- },
- os: {
- family: config['TARGET_SERVICE_OS_FAMILY']
- }
- },
- runner: {
- service: {
- git: {
- branch: config['CLIENT_BRANCH'],
- commit: config['CLIENT_COMMIT']
- }
- }
- }
-
-# ----- Run benchmarks --------------------------------------------------------
-
-Benchmarks.data_path = Pathname(config["DATA_SOURCE"])
-unless Benchmarks.data_path.exist?
- puts "ERROR: Data source at [#{Benchmarks.data_path}] not found".ansi(:bold, :red)
- exit(1)
-end
-
-Dir[File.expand_path("../../actions/*.rb", __FILE__)].each { |file| require file }
-
-Benchmarks.actions.each do |b|
- next unless ENV['FILTER'].nil? or ENV['FILTER'].include? b.action
-
- runner.setup(&b.setup) if b.setup
-
- result = runner.measure(
- action: b.action,
- category: b.category,
- warmups: b.warmups,
- repetitions: b.repetitions,
- operations: b.operations,
- &b.measure).run!
-
- puts " " +
- "[#{b.action}] ".ljust(16) +
- "#{b.repetitions}x ".ljust(10) +
- "mean=".ansi(:faint) +
- "#{coll = runner.stats.map(&:duration); ((coll.sum / coll.size.to_f)/1e+6).round}ms " +
- "runner=".ansi(:faint)+
- "#{runner.stats.any? { |s| s.outcome == 'failure' } ? 'failure' : 'success' } ".ansi( runner.stats.none? { |s| s.outcome == 'failure' } ? :green : :red ) +
- "report=".ansi(:faint)+
- "#{result ? 'success' : 'failure' }".ansi( result ? :green : :red )
-end
-
-# -----------------------------------------------------------------------------
-
-puts "Finished in #{(Time.mktime(0)+(Time.now.utc-start)).strftime("%H:%M:%S")}".ansi(:underline)
diff --git a/benchmarks/lib/benchmarks.rb b/benchmarks/lib/benchmarks.rb
deleted file mode 100644
index 09a621e471..0000000000
--- a/benchmarks/lib/benchmarks.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require "ostruct"
-require "time"
-require "rbconfig"
-
-require "ansi/core"
-require "elasticsearch"
-
-##
-# Module Benchmarks contains components for end-to-end benchmarking of the Ruby client for Elasticsearch.
-#
-module Benchmarks
- DEFAULT_WARMUPS = 0
- DEFAULT_REPETITIONS = 1_000
- DEFAULT_OPERATIONS = 1
-
- ##
- # Represents the benchmarking action.
- #
- class Action
- attr_reader :action, :category, :warmups, :repetitions, :operations, :setup, :measure
-
- # @param action [String] The name of the measured action
- # @param category [String] The category of the measured action
- # @param warmups [Number] The number of warmup runs
- # @param repetitions [Number] The number of repetitions
- # @param operations [Number] The number of operations in a single repetition
- # @param setup [Block] The operation setup
- # @param measure [Block] The measured operation
- def initialize(action:, category:, warmups:, repetitions:, operations:, setup:, measure:)
- raise ArgumentError.new("Required parameter [action] empty") if action.empty?
- raise ArgumentError.new("Required parameter [category] empty") if category.empty?
-
- @action = action
- @category = category
- @warmups = warmups || DEFAULT_WARMUPS
- @repetitions = repetitions || DEFAULT_REPETITIONS
- @operations = operations || DEFAULT_OPERATIONS
- @setup = setup
- @measure = measure
- end
- end
-
- ##
- # Registers an action for benchmarking.
- #
- # @option arguments [String] :action The name of the measured action
- # @option arguments [String] :category The category of the measured action
- # @option arguments [Number] :warmups The number of warmup runs
- # @option arguments [Number] :repetitions The number of repetitions
- # @option arguments [Number] :operations The number of operations in a single repetition
- # @option arguments [Block] :setup The operation setup
- # @option arguments [Block] :measure The measured operation
- #
- def self.register(arguments = {})
- self.actions << Action.new(
- action: arguments[:action],
- category: arguments[:category],
- warmups: arguments[:warmups],
- repetitions: arguments[:repetitions],
- operations: arguments[:operations],
- setup: arguments[:setup],
- measure: arguments[:measure]
- )
- end
-
- ##
- # Set data path for benchmarks.
- #
- # @param path [Pathname,String]
- #
- def self.data_path=(path)
- @data_path = Pathname(path)
- end
-
- ##
- # Return data path for benchmarks.
- #
- # @return [Pathname]
- #
- def self.data_path
- @data_path
- end
-
- ##
- # Returns the registered actions.
- #
- # @return [Array]
- #
- def self.actions
- @actions ||= []
- end
-
- ##
- # Module Runner contains components for running the benchmarks.
- #
- module Runner
- ##
- # Stats represents the measured statistics.
- #
- class Stats < OpenStruct; end
-
- ##
- # Errors contain error class for runner operations.
- #
- module Errors
- ##
- # ReportError represents an exception ocurring during reporting the results.
- #
- class ReportError < StandardError; end
-
- ##
- # SetupError represents an exception occuring during operation setup.
- #
- class SetupError < StandardError; end
-
- ##
- # WarmupError represents an exception occuring during operation warmup.
- #
- class WarmupError < StandardError; end
- end
-
- ##
- # The bulk size for reporting results.
- #
- BULK_BATCH_SIZE = 1000
-
- ##
- # The index name for reporting results.
- #
- INDEX_NAME="metrics-intake-#{Time.now.strftime("%Y-%m")}"
-
- ##
- # Runner represents a benchmarking runner.
- #
- # It is initialized with two Elasticsearch clients, one for running the benchmarks,
- # another one for reporting the results.
- #
- # Use the {#measure} method for adding a block which is executed and measured.
- #
- class Runner
- attr_reader :stats, :runner_client, :report_client, :warmups, :repetitions, :operations
-
- ##
- # @param runner_client [Elasticsearch::Client] The client for executing the measured operations.
- # @param report_client [Elasticsearch::Client] The client for storing the results.
- #
- def initialize(build_id:, category:, environment:, runner_client:, report_client:, target:, runner:)
- raise ArgumentError.new("Required parameter [build_id] empty") if build_id.empty?
- raise ArgumentError.new("Required parameter [environment] empty") if environment.empty?
-
- @action = ''
- @stats = []
- @warmups = 0
- @repetitions = 0
- @operations = 0
-
- @build_id = build_id
- @category = category
- @environment = environment
- @runner_client = runner_client
- @report_client = report_client
- @target_config = target
- @runner_config = runner
- end
-
- ##
- # Executes the measured block, capturing statistics, and reports the results.
- #
- # @return [Boolean]
- # @raise [Errors::ReportError]
- #
- def run!
- @stats = []
-
- # Run setup code
- begin
- @setup.arity < 1 ? self.instance_eval(&@setup) : @setup.call(self) if @setup
- rescue StandardError => e
- raise Errors::SetupError.new(e.inspect)
- end
-
- # Run warmups
- begin
- @warmups.times do |n|
- @measure.arity < 1 ? self.instance_eval(&@measure) : @measure.call(n, self) if @measure
- end
- rescue StandardError => e
- raise Errors::WarmupError.new(e.inspect)
- end
-
- # Run measured repetitions
- #
- # Cf. https://blog.dnsimple.com/2018/03/elapsed-time-with-ruby-the-right-way/
- @repetitions.times do |n|
- stat = Stats.new(start: Time.now.utc)
- start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
- begin
- result = @measure.arity < 1 ? result = self.instance_eval(&@measure) : result = @measure.call(n, self) if @measure
- if result == false
- stat.outcome = "failure"
- else
- stat.outcome = "success"
- end
- rescue StandardError => e
- stat.outcome = "failure"
- ensure
- stat.duration = ((Process.clock_gettime(Process::CLOCK_MONOTONIC)-start) * 1e+9 ).to_i
- @stats << stat
- end
- end
-
- # Report results
- begin
- __report
- rescue StandardError => e
- puts "ERROR: #{e.inspect}"
- return false
- end
-
- return true
- end
-
- ##
- # Configure a setup for the measure operation.
- #
- # @return [self]
- #
- def setup &block
- @setup = block
- return self
- end
-
- ##
- # Configure the measure operation.
- #
- # @param action [String] A human-readable name of the operation.
- # @param category [String] The operation category.
- # @param warmups [Number] The number of warmups.
- # @param repetitions [Number] The number of repetitions.
- # @param operations [Number] The number of operations in a single repetition.
- #
- # @return [self]
- #
- def measure(action:, category:, warmups:, repetitions:, operations:, &block)
- raise ArgumentError.new("Required parameter [action] empty") if action.empty?
- raise ArgumentError.new("Required parameter [category] empty") if category.empty?
- raise ArgumentError.new("Required parameter [repetitions] not a number") unless repetitions.is_a? Numeric
- raise ArgumentError.new("Required parameter [operations] not a number") unless operations.is_a? Numeric
-
- @action = action
- @category = category
- @warmups = warmups
- @repetitions = repetitions
- @operations = operations
- @measure = block
- return self
- end
-
- ##
- # Stores the result in the reporting cluster.
- #
- # @api private
- #
- def __report
- @stats.each_slice(BULK_BATCH_SIZE) do |slice|
- payload = slice.map do |s|
- { index: {
- data: {
- :'@timestamp' => s.start.iso8601,
- labels: {
- build_id: @build_id,
- client: 'elasticsearch-ruby',
- environment: @environment.to_s
- },
- tags: ['bench', 'elasticsearch-ruby'],
- event: {
- action: @action,
- duration: s.duration,
- outcome: s.outcome
- },
- benchmark: {
- build_id: @build_id,
- environment: @environment.to_s,
- category: @category.to_s,
- repetitions: @repetitions,
- operations: @operations,
- runner: {
- service: @runner_config[:service].merge({
- type: 'client',
- name: 'elasticsearch-ruby',
- version: Elasticsearch::VERSION
- }),
- runtime: {
- name: 'ruby', version: RbConfig::CONFIG['ruby_version']
- },
- os: {
- family: RbConfig::CONFIG['host_os'].split('_').first[/[a-z]+/i].downcase
- }
- },
- target: @target_config
- }
- }
- }
- }
- end
-
- begin
-
- rescue Elasticsearch::Transport::Transport::Error => e
- puts "ERROR: #{e.inspect}"
- raise e
- end
-
- response = @report_client.bulk index: INDEX_NAME, body: payload
- if response['errors'] || response['items'].any? { |i| i.values.first['status'] > 201 }
- raise Errors::ReportError.new("Error saving benchmark results to report cluster")
- end
- end
- end
- end
- end
-end
diff --git a/catalog-info.yaml b/catalog-info.yaml
new file mode 100644
index 0000000000..25413dfabf
--- /dev/null
+++ b/catalog-info.yaml
@@ -0,0 +1,19 @@
+apiVersion: backstage.io/v1alpha1
+kind: Resource
+metadata:
+ name: buildkite-pipeline-elasticsearch-ruby
+spec:
+ implementation:
+ apiVersion: buildkite.elastic.dev/v1
+ kind: Pipeline
+ metadata:
+ description: Elasticsearch Ruby Client
+ name: elasticsearch-ruby
+ spec:
+ repository: elastic/elasticsearch-ruby
+ teams:
+ devtools-team: {}
+ everyone:
+ access_level: READ_ONLY
+ owner: group:devtools-team
+ type: buildkite-pipeline
diff --git a/docs/advanced-config.asciidoc b/docs/advanced-config.asciidoc
deleted file mode 100644
index cb0a54e77c..0000000000
--- a/docs/advanced-config.asciidoc
+++ /dev/null
@@ -1,359 +0,0 @@
-[[advanced-config]]
-=== Advanced configuration
-
-The client supports many configurations options for setting up and managing
-connections, configuring logging, customizing the transport library, and so on.
-
-[discrete]
-[[setting-hosts]]
-==== Setting hosts
-
-To connect to a specific {es} host:
-
-```ruby
-Elasticsearch::Client.new(host: 'search.myserver.com')
-```
-
-To connect to a host with specific port:
-
-```ruby
-Elasticsearch::Client.new(host: 'myhost:8080')
-```
-
-To connect to multiple hosts:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['myhost1', 'myhost2'])
-```
-
-Instead of strings, you can pass host information as an array of Hashes:
-
-```ruby
-Elasticsearch::Client.new(hosts: [ { host: 'myhost1', port: 8080 }, { host: 'myhost2', port: 8080 } ])
-```
-
-NOTE: When specifying multiple hosts, you might want to enable the
-`retry_on_failure` or `retry_on_status` options to perform a failed request on
-another node (refer to <>).
-
-Common URL parts – scheme, HTTP authentication credentials, URL prefixes, and so
-on – are handled automatically:
-
-```ruby
-Elasticsearch::Client.new(url: 'https://username:password@api.server.org:4430/search')
-```
-
-You can pass multiple URLs separated by a comma:
-
-```ruby
-Elasticsearch::Client.new(urls: 'http://localhost:9200,http://localhost:9201')
-```
-
-Another way to configure URLs is to export the `ELASTICSEARCH_URL` variable.
-
-The client is automatically going to use a round-robin algorithm across the
-hosts (unless you select or implement a different <>).
-
-
-[discrete]
-[[default-port]]
-==== Default port
-
-The default port is `9200`. Specify a port for your host(s) if they differ from
-this default.
-
-If you are using Elastic Cloud, the default port is port `9243`. You must supply
-your username and password separately, and optionally a port. Refer to
-<>.
-
-
-[discrete]
-[[logging]]
-==== Logging
-
-To log requests and responses to standard output with the default logger (an
-instance of Ruby's `::Logger` class), set the log argument to true:
-
-```ruby
-Elasticsearch::Client.new(log: true)
-```
-
-You can also use https://github.com/elastic/ecs-logging-ruby[`ecs-logging`]
-which is a set of libraries that enables you to transform your application logs
-to structured logs that comply with the
-https://www.elastic.co/guide/en/ecs/current/ecs-reference.html[Elastic Common Schema]. See <>.
-
-To trace requests and responses in the Curl format, set the `trace` argument:
-
-```ruby
-Elasticsearch::Client.new(trace: true)
-```
-
-You can customize the default logger or tracer:
-
-[source,ruby]
-------------------------------------
-client.transport.logger.formatter = proc { |s, d, p, m| "#{s}: #{m}\n" }
-client.transport.logger.level = Logger::INFO
-------------------------------------
-
-Or, you can use a custom `::Logger` instance:
-
-```ruby
-Elasticsearch::Client.new(logger: Logger.new(STDERR))
-```
-
-You can pass the client any conforming logger implementation:
-
-[source,ruby]
-------------------------------------
-require 'logging' # https://github.com/TwP/logging/
-
-log = Logging.logger['elasticsearch']
-log.add_appenders Logging.appenders.stdout
-log.level = :info
-
-client = Elasticsearch::Client.new(logger: log)
-------------------------------------
-
-
-[discrete]
-[[apm-integration]]
-==== APM integration
-
-This client integrates seamlessly with Elastic APM via the Elastic APM Agent. It
-automatically captures client requests if you are using the agent on your code.
-If you're using `elastic-apm` v3.8.0 or up, you can set
-`capture_elasticsearch_queries` to `true` in `config/elastic_apm.yml` to also
-capture the body from requests in {es}. Refer to
-https://github.com/elastic/elasticsearch-ruby/tree/main/docs/examples/apm[this example].
-
-
-[discrete]
-[[custom-http-headers]]
-==== Custom HTTP Headers
-
-You can set a custom HTTP header on the client's initializer:
-
-[source,ruby]
-------------------------------------
-client = Elasticsearch::Client.new(
- transport_options: {
- headers:
- {user_agent: "My App"}
- }
-)
-------------------------------------
-
-You can also pass in `headers` as a parameter to any of the API Endpoints to set
-custom headers for the request:
-
-```ruby
-client.search(index: 'myindex', q: 'title:test', headers: {user_agent: "My App"})
-```
-
-
-[discrete]
-[[x-opaque-id]]
-==== Identifying running tasks with X-Opaque-Id
-
-The X-Opaque-Id header allows to track certain calls, or associate certain tasks
-with the client that started them (refer to
-https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#_identifying_running_tasks[the documentation]).
-To use this feature, you need to set an id for `opaque_id` on the client on each
-request. Example:
-
-[source,ruby]
-------------------------------------
-client = Elasticsearch::Client.new
-client.search(index: 'myindex', q: 'title:test', opaque_id: '123456')
-------------------------------------
-
-The search request includes the following HTTP Header:
-
-```ruby
-X-Opaque-Id: 123456
-```
-
-You can also set a prefix for X-Opaque-Id when initializing the client. This is
-prepended to the id you set before each request if you're using X-Opaque-Id.
-Example:
-
-[source,ruby]
-------------------------------------
-client = Elasticsearch::Client.new(opaque_id_prefix: 'eu-west1_')
-client.search(index: 'myindex', q: 'title:test', opaque_id: '123456')
-------------------------------------
-
-The request includes the following HTTP Header:
-
-```ruby
-X-Opaque-Id: eu-west1_123456
-```
-
-
-[discrete]
-[[setting-timeouts]]
-==== Setting Timeouts
-
-For many operations in {es}, the default timeouts of HTTP libraries are too low.
-To increase the timeout, you can use the `request_timeout` parameter:
-
-```ruby
-Elasticsearch::Client.new(request_timeout: 5*60)
-```
-
-You can also use the `transport_options` argument documented below.
-
-
-[discrete]
-[[randomizing-hosts]]
-==== Randomizing Hosts
-
-If you pass multiple hosts to the client, it rotates across them in a
-round-robin fashion by default. When the same client would be running in
-multiple processes (for example, in a Ruby web server such as Thin), it might
-keep connecting to the same nodes "at once". To prevent this, you can randomize
-the hosts collection on initialization and reloading:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], randomize_hosts: true)
-```
-
-
-[discrete]
-[[retry-failures]]
-==== Retrying on Failures
-
-When the client is initialized with multiple hosts, it makes sense to retry a
-failed request on a different host:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], retry_on_failure: true)
-```
-
-By default, the client retries the request 3 times. You can specify how many
-times to retry before it raises an exception by passing a number to
-`retry_on_failure`:
-
-```ruby
- Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], retry_on_failure: 5)
-```
-
-You can also use `retry_on_status` to retry when specific status codes are
-returned:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], retry_on_status: [502, 503])
-```
-
-These two parameters can also be used together:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], retry_on_status: [502, 503], retry_on_failure: 10)
-```
-
-You can also set a `delay_on_retry` value in milliseconds. This will add a delay to wait between retries:
-
-```ruby
- Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], retry_on_failure: 5, delay_on_retry: 1000)
-```
-
-[discrete]
-[[reload-hosts]]
-==== Reloading Hosts
-
-{es} dynamically discovers new nodes in the cluster by default. You can leverage
-this in the client, and periodically check for new nodes to spread the load.
-
-To retrieve and use the information from the
-https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html[Nodes Info API]
-on every 10,000th request:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], reload_connections: true)
-```
-
-You can pass a specific number of requests after which reloading should be
-performed:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], reload_connections: 1_000)
-```
-
-To reload connections on failures, use:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], reload_on_failure: true)
-```
-
-The reloading timeouts if not finished under 1 second by default. To change the
-setting:
-
-```ruby
-Elasticsearch::Client.new(hosts: ['localhost:9200', 'localhost:9201'], sniffer_timeout: 3)
-```
-
-NOTE: When using reloading hosts ("sniffing") together with authentication, pass
-the scheme, user and password with the host info – or, for more clarity, in the
-`http` options:
-
-[source,ruby]
-------------------------------------
-Elasticsearch::Client.new(
- host: 'localhost:9200',
- http: { scheme: 'https', user: 'U', password: 'P' },
- reload_connections: true,
- reload_on_failure: true
-)
-------------------------------------
-
-
-[discrete]
-[[connection-selector]]
-==== Connection Selector
-
-By default, the client rotates the connections in a round-robin fashion, using the `Elastic::Transport::Transport::Connections::Selector::RoundRobin` strategy.
-
-You can implement your own strategy to customize the behaviour. For example, let's have a "rack aware" strategy, which prefers the nodes with a specific attribute. The strategy uses the other nodes, only when these are unavailable:
-
-[source,ruby]
-------------------------------------
-class RackIdSelector
- include Elastic::Transport::Transport::Connections::Selector::Base
-
- def select(options={})
- connections.select do |c|
- # Try selecting the nodes with a `rack_id:x1` attribute first
- c.host[:attributes] && c.host[:attributes][:rack_id] == 'x1'
- end.sample || connections.to_a.sample
- end
-end
-
-Elasticsearch::Client.new hosts: ['x1.search.org', 'x2.search.org'], selector_class: RackIdSelector
-------------------------------------
-
-
-[discrete]
-[[serializer-implementations]]
-==== Serializer Implementations
-
-By default, the https://rubygems.org/gems/multi_json[MultiJSON] library is used as the serializer implementation, and it picks up the "right" adapter based on gems available.
-
-The serialization component is pluggable, though, so you can write your own by including the `Elastic::Transport::Transport::Serializer::Base` module, implementing the required contract, and passing it to the client as the `serializer_class` or `serializer` parameter.
-
-
-[discrete]
-[[exception-handling]]
-==== Exception Handling
-
-The library defines a
-https://github.com/elastic/elastic-transport-ruby/blob/main/lib/elastic/transport/transport/errors.rb[number of exception classes] for various client and server errors, as well as unsuccessful HTTP responses, making it possible to rescue specific exceptions with desired granularity.
-
-The highest-level exception is `Elastic::Transport::Transport::Error` and is raised for any generic client or server errors.
-
-`Elastic::Transport::Transport::ServerError` is raised for server errors only.
-
-As an example for response-specific errors, a 404 response status raises an `Elastic::Transport::Transport::Errors::NotFound` exception.
-
-Finally, `Elastic::Transport::Transport::SnifferTimeoutError` is raised when connection reloading ("sniffing") times out.
diff --git a/docs/api.asciidoc b/docs/api.asciidoc
deleted file mode 100644
index 85386c8122..0000000000
--- a/docs/api.asciidoc
+++ /dev/null
@@ -1,220 +0,0 @@
-[[api]]
-=== Elasticsearch API
-
-The `elasticsearch-api` library provides a Ruby implementation of the https://www.elastic.co/elastic-stack/[Elasticsearch] REST API.
-
-[discrete]
-[[api-install]]
-==== Installation
-
-Install the package from https://rubygems.org[Rubygems]:
-
-[source,bash]
-----------------------------
-gem install elasticsearch-api
-----------------------------
-
-To use an unreleased version, either add it to your `Gemfile` for https://bundler.io/[Bundler]:
-
-[source,bash]
-----------------------------
-gem 'elasticsearch-api', git: 'git://github.com/elasticsearch/elasticsearch-ruby.git'
-----------------------------
-
-or install it from a source code checkout:
-
-[source,bash]
-----------------------------
-git clone https://github.com/elasticsearch/elasticsearch-ruby.git
-cd elasticsearch-ruby/elasticsearch-api
-bundle install
-rake install
-----------------------------
-
-[discrete]
-[[api-example-usage]]
-==== Example usage
-
-The library is designed as a group of standalone Ruby modules, which can be mixed into a class
-providing connection to Elasticsearch -- an Elasticsearch client.
-
-[discrete]
-===== Usage with the `elasticsearch` gem
-
-**When you use the client from the https://github.com/elasticsearch/elasticsearch-ruby[`elasticsearch-ruby`] client, the library modules have been already included**, so you just call the API methods.
-
-The response will be an `Elasticsearch::API::Response` object which wraps an `Elasticsearch::Transport::Transport::Response` object. It provides `body`, `status` and `headers` methods, but you can treat is as a hash and access the keys directly.
-
-[source,rb]
-----------------------------
-require 'elasticsearch'
-
-client = Elasticsearch::Client.new
-
->response = client.index(index: 'myindex', id: 1, body: { title: 'Test' })
-=> #"myindex",
- "_id"=>"1",
- "_version"=>2,
- "result"=>"updated",
- "_shards"=>{"total"=>1, "successful"=>1, "failed"=>0},
- "_seq_no"=>1,
- "_primary_term"=>1},
- @headers=
- {"x-elastic-product"=>"Elasticsearch",
- "content-type"=>"application/json",
- "content-encoding"=>"gzip",
- "content-length"=>"130"},
- @status=200>>
-
-> response['result']
-=> "updated"
-
-client.search(index: 'myindex', body: { query: { match: { title: 'test' } } })
-# => => #223,
- "timed_out"=>false,
- "_shards"=>{"total"=>2, "successful"=>2, "skipped"=>0, "failed"=>0},
- "hits"=>
- {"total"=>{"value"=>1, "relation"=>"eq"},
- "max_score"=>0.2876821,
- "hits"=>[{"_index"=>"myindex", "_id"=>"1", "_score"=>0.2876821, "_source"=>{"title"=>"Test"}}]}},
- @headers=
- {"x-elastic-product"=>"Elasticsearch",
- "content-type"=>"application/json",
- "content-encoding"=>"gzip",
- "content-length"=>"188"},
- @status=200>>
-----------------------------
-
-Full documentation and examples are included as RDoc annotations in the source code and available online at .
-
-[discrete]
-===== Usage with a custom client
-
-When you want to mix the library with your own client, it must conform to the following _contract_:
-
-* It responds to a `perform_request(method, path, params, body, headers)` method,
-* the method returns an object with `status`, `body` and `headers` methods.
-
-A simple client could look like this (_with a dependency on `active_support` to parse the query params_):
-
-[source,rb]
-----------------------------
-require 'multi_json'
-require 'faraday'
-require 'elasticsearch/api'
-
-class MySimpleClient
- include Elasticsearch::API
-
- CONNECTION = ::Faraday::Connection.new(url: 'http://localhost:9200')
-
- def perform_request(method, path, params, body, headers = nil)
- puts "--> #{method.upcase} #{path} #{params} #{body} #{headers}"
-
- CONNECTION.run_request \
- method.downcase.to_sym,
- path_with_params(path, params),
- ( body ? MultiJson.dump(body): nil ),
- {'Content-Type' => 'application/json'}
- end
-
- private
-
- def path_with_params(path, params)
- return path if params.blank?
-
- case params
- when String
- "#{path}?#{params}"
- when Hash
- "#{path}?#{URI.encode_www_form(params)}"
- else
- raise ArgumentError, "Cannot parse params: '#{params}'"
- end
- end
-end
-
-client = MySimpleClient.new
-
-p client.cluster.health
-# --> GET _cluster/health {}
-# => "{"cluster_name":"elasticsearch" ... }"
-
-p client.index(index: 'myindex', id: 'custom', body: { title: "Indexing from my client" })
-# --> PUT myindex/mytype/custom {} {:title=>"Indexing from my client"}
-# => "{"ok":true, ... }"
-----------------------------
-
-[discrete]
-===== Using JSON Builders
-
-Instead of passing the `:body` argument as a Ruby _Hash_, you can pass it as a _String_, potentially
-taking advantage of JSON builders such as https://github.com/rails/jbuilder[JBuilder] or
-https://github.com/bsiggelkow/jsonify[Jsonify]:
-
-[source,rb]
-----------------------------
-require 'jbuilder'
-
-query = Jbuilder.encode do |json|
- json.query do
- json.match do
- json.title do
- json.query 'test 1'
- json.operator 'and'
- end
- end
- end
-end
-
-client.search(index: 'myindex', body: query)
-
-# 2013-06-25 09:56:05 +0200: GET http://localhost:9200/myindex/_search [status:200, request:0.015s, query:0.011s]
-# 2013-06-25 09:56:05 +0200: > {"query":{"match":{"title":{"query":"test 1","operator":"and"}}}}
-# ...
-# => {"took"=>21, ..., "hits"=>{"total"=>1, "hits"=>[{ "_source"=>{"title"=>"Test 1", ...}}]}}
-----------------------------
-
-[discrete]
-===== Using Hash Wrappers
-
-For a more comfortable access to response properties, you may wrap it in one of the _Hash_ "object access"
-wrappers, such as https://github.com/intridea/hashie[`Hashie::Mash`]:
-
-[source,rb]
-----------------------------
-require 'hashie'
-
-response = client.search(
- index: 'myindex',
- body: {
- query: { match: { title: 'test' } },
- aggregations: { tags: { terms: { field: 'tags' } } }
- }
-)
-
-mash = Hashie::Mash.new(response)
-
-mash.hits.hits.first._source.title
-# => 'Test'
-----------------------------
-
-[discrete]
-===== Using a Custom JSON Serializer
-
-The library uses the https://rubygems.org/gems/multi_json/[MultiJson] gem by default but allows you to set a custom JSON library, provided it uses the standard `load/dump` interface:
-
-[source,rb]
-----------------------------
-Elasticsearch::API.settings[:serializer] = JrJackson::Json
-Elasticsearch::API.serializer.dump({foo: 'bar'})
-# => {"foo":"bar"}
-----------------------------
diff --git a/docs/basic-config.asciidoc b/docs/basic-config.asciidoc
deleted file mode 100644
index d23d517166..0000000000
--- a/docs/basic-config.asciidoc
+++ /dev/null
@@ -1,36 +0,0 @@
-[[basic-config]]
-=== Basic configuration
-
-The table below contains the most important initialization parameters that you
-can use.
-
-
-[cols="<,<,<"]
-|===
-
-| **Parameter** | **Data type** | **Description**
-| `adapter` | Symbol | A specific adapter for Faraday (for example, `:patron`).
-| `api_key` | String, Hash | For API key Authentication. Either the base64 encoding of `id` and `api_key` joined by a colon as a string, or a hash with the `id` and `api_key` values.
-| `compression` | Boolean | Whether to compress requests. Gzip compression is used. Defaults to `false`. Responses are automatically inflated if they are compressed. If a custom transport object is used, it must handle the request compression and response inflation.
-| `enable_meta_header` | Boolean | Whether to enable sending the meta data header to Cloud. Defaults to `true`.
-| `hosts` | String, Array | Single host passed as a string or hash, or multiple hosts passed as an array; `host` or `url` keys are also valid.
-| `log` | Boolean | Whether to use the default logger. Disabled by default.
-| `logger` | Object | An instance of a Logger-compatible object.
-| `opaque_id_prefix` | String | Sets a prefix for X-Opaque-Id when initializing the client. This is prepended to the id you set before each request if you're using X-Opaque-Id.
-| `randomize_hosts` | Boolean | Whether to shuffle connections on initialization and reload. Defaults to `false`.
-| `reload_connections` | Boolean, Number | Whether to reload connections after X requests. Defaults to `false`.
-| `reload_on_failure` | Boolean | Whether to reload connections after failure. Defaults to `false`.
-| `request_timeout` | Integer | The request timeout to be passed to transport in options.
-| `resurrect_after` | Integer | Specifies after how many seconds a dead connection should be tried again.
-| `retry_on_failure` | Boolean, Number | Whether to retry X times when request fails before raising and exception. Defaults to `false`.
-| `retry_on_status` | Array, Number | Specifies which status code needs to be returned to retry.
-| `selector` | Constant | An instance of selector strategy implemented with {Elastic::Transport::Transport::Connections::Selector::Base}.
-| `send_get_body_as` | String | Specifies the HTTP method to use for GET requests with a body. Defaults to `GET`.
-| `serializer_class` | Constant | Specifies a serializer class to use. It is initialized by the transport and passed the transport instance.
-| `sniffer_timeout` | Integer | Specifieds the timeout for reloading connections in seconds. Defaults to `1`.
-| `trace` | Boolean | Whether to use the default tracer. Disabled by default.
-| `tracer` | Object | Specifies an instance of a Logger-compatible object.
-| `transport` | Object | Specifies a transport instance.
-| `transport_class` | Constant | Specifies a transport class to use. It is initialized by the client and passed hosts and all arguments.
-| `transport_options` | Hash | Specifies the options to be passed to the `Faraday::Connection` constructor.
-|===
diff --git a/docs/config.asciidoc b/docs/config.asciidoc
deleted file mode 100644
index c9897f8313..0000000000
--- a/docs/config.asciidoc
+++ /dev/null
@@ -1,9 +0,0 @@
-[[ruby-config]]
-== Configuration
-
-This page contains information about how to configure the Ruby client tailored
-to your needs. Almost every aspect of the client is configurable. However, in
-most cases you only need to set a couple of parameters.
-
-* <>
-* <>
\ No newline at end of file
diff --git a/docs/connecting.asciidoc b/docs/connecting.asciidoc
deleted file mode 100644
index 3f988cfe67..0000000000
--- a/docs/connecting.asciidoc
+++ /dev/null
@@ -1,352 +0,0 @@
-[[connecting]]
-== Connecting
-
-This page contains the information you need to connect and use the Client with
-{es}.
-
-**On this page**
-
-* <>
-* <>
-* <>
-* <>
-
-[discrete]
-[[client-auth]]
-=== Authentication
-
-This document contains code snippets to show you how to connect to various {es} providers.
-
-[discrete]
-[[auth-ec]]
-==== Elastic Cloud
-
-If you are using https://www.elastic.co/cloud[Elastic Cloud], the client offers an easy way to connect to it. You need the Cloud ID that you can find in the cloud console, then your username and password.
-
-image::docs/images/cloud_id.png["Cloud ID"]
-
-Once you have collected the Cloud ID you can use the client to connect to your Elastic Cloud instance, as follows:
-
-[source,ruby]
-------------------------------------
-require 'elasticsearch'
-
-client = Elasticsearch::Client.new(
- cloud_id: ''
- user: '',
- password: '',
-)
-------------------------------------
-
-You can also connect to the Cloud by using API Key authentication. You can generate an `API key` in the `Management` page under the section `Security`.
-
-image::docs/images/cloud_api_key.png["API key"]
-
-When you click on `Create API key` you can choose a name and set the other options (eg. restrict privileges, expire after time, etc).
-
-image::docs/images/api_key_name.png["Choose an API name"]
-
-After this step you will get the `API key` in the API keys page.
-
-image::docs/images/cloud_api_key.png["API key"]
-
-**IMPORTANT**: you need to copy and store the `API key` in a secure place, since you will not be able to view it again in Elastic Cloud.
-
-Once you have collected the `Cloud ID` and the `API key` you can use the client
-to connect to your Elastic Cloud instance, as follows:
-
-[source,ruby]
-------------------------------------
-client = Elasticsearch::Client.new(
- cloud_id: '',
- api_key: ''
-)
-------------------------------------
-
-If you create the API Key through the dev console or the REST API, you may get instead a pair of `id` and `APIKey` values. The client also accepts a Hash for the `api_key` parameter, so you can pass in these values and it will encode the API Key internally:
-
-[source,ruby]
-------------------------------------
-client = Elasticsearch::Client.new(
- cloud_id: '',
- api_key: {id: '', api_key: ''}
-)
-------------------------------------
-
-[discrete]
-[[connect-self-managed]]
-=== Connecting to a self-managed cluster
-
-{es} 8.0 offers security by default, that means authentication and TLS are enabled.
-
-To connect to the {es} cluster you’ll need to configure the Ruby {es} client to use HTTPS with the generated CA certificate in order to make requests successfully.
-
-If you’re just getting started with {es} we recommend reading the documentation on configuring and starting {es} to ensure your cluster is running as expected.
-
-When you start {es} for the first time you’ll see a distinct block like the one below in the output from {es} (you may have to scroll up if it’s been a while):
-
-
-```sh
-----------------------------------------------------------------
--> Elasticsearch security features have been automatically configured!
--> Authentication is enabled and cluster connections are encrypted.
-
--> Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
- lhQpLELkjkrawaBoaz0Q
-
--> HTTP CA certificate SHA-256 fingerprint:
- a52dd93511e8c6045e21f16654b77c9ee0f34aea26d9f40320b531c474676228
-...
-----------------------------------------------------------------
-```
-
-Note down the `elastic` user password and HTTP CA fingerprint for the next sections. In the examples below they will be stored in the variables `ELASTIC_PASSWORD` and `CERT_FINGERPRINT` respectively.
-
-Depending on the circumstances there are two options for verifying the HTTPS connection, either verifying with the CA certificate itself or via the HTTP CA certificate fingerprint.
-
-
-[discrete]
-[[ca-certificates]]
-==== Verifying HTTPS with CA certificates
-
-The generated root CA certificate can be found in the `certs` directory in your {es} config location (`$ES_CONF_PATH/certs/http_ca.crt`). If you're running {es} in Docker there is https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html[additional documentation for retrieving the CA certificate].
-
-Once you have the `http_ca.crt` file somewhere accessible pass the path to the client via `ca_certs`:
-
-[source,ruby]
-------------------------------------
-client = Elasticsearch::Client.new(
- host: "https://elastic:#{ELASTIC_PASSWORD}@localhost:9200",
- transport_options: { ssl: { ca_path: CERT_DIR } }
-)
-------------------------------------
-
-[discrete]
-[[ca-fingerprint]]
-==== Verifying HTTPS with certificate fingerprints
-
-
-This method of verifying the HTTPS connection takes advantage of the certificate fingerprint value noted down earlier. Take this SHA256 fingerprint value and pass it to the Ruby {es} client via `ca_fingerprint`:
-
-[source,ruby]
-------------------------------------
-# Colons and uppercase/lowercase don't matter when using
-# the 'ca_fingerprint' parameter
-CERT_FINGERPRINT = '64F2593F...'
-
-# Password for the 'elastic' user generated by Elasticsearch
-ELASTIC_PASSWORD = ""
-
-client = Elasticsearch::Client.new(
- host: "https://elastic:#{ELASTIC_PASSWORD}@localhost:9200",
- transport_options: { ssl: { verify: false } },
- ca_fingerprint: CERT_FINGERPRINT
-)
-------------------------------------
-
-The verification will be run once per connection.
-
-
-The certificate fingerprint can be calculated using `openssl x509` with the certificate file:
-
-[source,sh]
-----
-openssl x509 -fingerprint -sha256 -noout -in /path/to/http_ca.crt
-----
-
-If you don't have access to the generated CA file from {es} you can use the following script to output the root CA fingerprint of the {es} instance with `openssl s_client`:
-
-[source,sh]
-----
-# Replace the values of 'localhost' and '9200' to the
-# corresponding host and port values for the cluster.
-openssl s_client -connect localhost:9200 -servername localhost -showcerts /dev/null \
- | openssl x509 -fingerprint -sha256 -noout -in /dev/stdin
-----
-
-The output of `openssl x509` will look something like this:
-
-[source,sh]
-----
-SHA256 Fingerprint=A5:2D:D9:35:11:E8:C6:04:5E:21:F1:66:54:B7:7C:9E:E0:F3:4A:EA:26:D9:F4:03:20:B5:31:C4:74:67:62:28
-----
-
-
-
-
-[discrete]
-[[auth-api-key]]
-==== API Key authentication
-
-You can also use https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html[ApiKey] authentication.
-
-NOTE: If you provide both basic authentication credentials and the ApiKey configuration, the ApiKey takes precedence.
-
-[source,ruby]
-------------------------------------
-Elasticsearch::Client.new(
- host: host,
- transport_options: transport_options,
- api_key: credentials
-)
-------------------------------------
-
-Where credentials is either the base64 encoding of `id` and `api_key` joined by
-a colon or a hash with the `id` and `api_key`:
-
-[source,ruby]
-------------------------------------
-Elasticsearch::Client.new(
- host: host,
- transport_options: transport_options,
- api_key: {id: 'my_id', api_key: 'my_api_key'}
-)
-------------------------------------
-
-
-[discrete]
-[[auth-basic]]
-==== Basic authentication
-
-You can pass the authentication credentials, scheme and port in the host
-configuration hash:
-
-[source,ruby]
-------------------------------------
-client = Elasticsearch::Client.new(
- hosts:
- [
- {
- host: 'my-protected-host',
- port: '443',
- user: 'USERNAME',
- password: 'PASSWORD',
- scheme: 'https'
- }
- ]
-)
-------------------------------------
-
-Or use the common URL format:
-
-[source,ruby]
-------------------------------------
-client = Elasticsearch::Client.new(url: 'https://username:password@localhost:9200')
-------------------------------------
-
-To pass a custom certificate for SSL peer verification to Faraday-based clients,
-use the `transport_options` option:
-
-[source,ruby]
-------------------------------------
-Elasticsearch::Client.new(
- url: 'https://username:password@localhost:9200',
- transport_options: {
- ssl: { ca_file: '/path/to/cacert.pem' }
- }
-)
-------------------------------------
-
-[discrete]
-[[client-usage]]
-=== Usage
-
-The following snippet shows an example of using the Ruby client:
-
-[source,ruby]
-------------------------------------
-require 'elasticsearch'
-
-client = Elasticsearch::Client.new log: true
-
-client.cluster.health
-
-client.index(index: 'my-index', id: 1, body: { title: 'Test' })
-
-client.indices.refresh(index: 'my-index')
-
-client.search(index: 'my-index', body: { query: { match: { title: 'test' } } })
-------------------------------------
-
-
-[discrete]
-[[client-faas]]
-=== Using the Client in a Function-as-a-Service Environment
-
-This section illustrates the best practices for leveraging the {es} client in a Function-as-a-Service (FaaS) environment. The most influential optimization is to initialize the client outside of the function, the global scope. This practice does not only improve performance but also enables background functionality as – for example – sniffing. The following examples provide a skeleton for the best practices.
-
-[discrete]
-==== GCP Cloud Functions
-
-[source,ruby]
-------------------------------------
-require 'functions_framework'
-require 'elasticsearch'
-
-client = Elasticsearch::Client.new(
- cloud_id: "elasic-cloud-id",
- user: "elastic",
- password: "password",
- log: true
-)
-
-FunctionsFramework.http "hello_world" do |request|
- client.search(
- index: 'stack-overflow',
- body: {
- query: {
- match: {
- title: {
- query: 'phone application'
- }
- }
- }
- }
- )
-end
-------------------------------------
-
-[discrete]
-==== AWS Lambda
-
-[source,ruby]
-------------------------------------
-require 'elasticsearch'
-
-def client
- @client ||= Elasticsearch::Client.new(
- cloud_id: "elastic-cloud-id",
- user: "elastic",
- password: "password",
- log: true
- )
-end
-
-def lambda_handler(event:, context:)
- client.search(
- index: 'stack-overflow',
- body: {
- query: {
- match: {
- title: {
- query: 'phone application'
- }
- }
- }
- }
- )
-end
-------------------------------------
-
-Resources used to assess these recommendations:
-
-* https://cloud.google.com/functions/docs/bestpractices/tips#use_global_variables_to_reuse_objects_in_future_invocations[GCP Cloud Functions: Tips & Tricks]
-* https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html[Best practices for working with AWS Lambda functions]
-
-[discrete]
-[[client-comp]]
-=== Enabling the Compatibility Mode
-
-The Elasticsearch server version 8.0 is introducing a new compatibility mode that allows you a smoother upgrade experience from 7 to 8. In a nutshell, you can use the latest 7.x Elasticsearch client with an 8.x Elasticsearch server, giving more room to coordinate the upgrade of your codebase to the next major version.
-
-If you want to leverage this functionality, please make sure that you are using the latest 7.x client and set the environment variable `ELASTIC_CLIENT_APIVERSIONING` to `true`. The client is handling the rest internally. For every 8.0 and beyond client, you're all set! The compatibility mode is enabled by default.
diff --git a/docs/docset.yml b/docs/docset.yml
new file mode 100644
index 0000000000..d1f01be642
--- /dev/null
+++ b/docs/docset.yml
@@ -0,0 +1,12 @@
+project: 'Ruby client'
+exclude:
+ - examples/**
+cross_links:
+ - docs-content
+ - ecs
+ - ecs-logging-ruby
+toc:
+ - toc: reference
+ - toc: release-notes
+subs:
+ es: "Elasticsearch"
diff --git a/docs/dsl.asciidoc b/docs/dsl.asciidoc
deleted file mode 100644
index 922624a4fa..0000000000
--- a/docs/dsl.asciidoc
+++ /dev/null
@@ -1,6 +0,0 @@
-[[dsl]]
-=== Elasticsearch DSL
-
-The https://github.com/elastic/elasticsearch-dsl-ruby[elasticsearch-dsl] gem provides a Ruby API for the https://www.elasticsearch.com/guide/en/elasticsearch/reference/current/query-dsl.html[Elasticsearch Query DSL]. The library allows to programmatically build complex search definitions for {es} in Ruby, which are translated to Hashes, and ultimately, JSON, the language of {es}.
-
-See https://github.com/elastic/elasticsearch-dsl-ruby#elasticsearchdsl[the README] for more information.
diff --git a/docs/ecs.asciidoc b/docs/ecs.asciidoc
deleted file mode 100644
index 218708038b..0000000000
--- a/docs/ecs.asciidoc
+++ /dev/null
@@ -1,34 +0,0 @@
-[[ecs]]
-=== Elastic Common Schema (ECS)
-
-The https://www.elastic.co/guide/en/ecs/current/ecs-reference.html[Elastic Common Schema (ECS)] is an open source format that defines a common set of fields to be used when storing event data like logs in Elasticsearch.
-
-You can use the library https://github.com/elastic/ecs-logging-ruby[ecs-logging] which is a set of libraries that enables you to transform your application logs to structured logs that comply with the ECS format.
-
-Add this line to your application's Gemfile:
-
-[source,ruby]
-------------------------------------
-gem 'ecs-logging'
-------------------------------------
-
-Then execute `bundle install`. Or install from the command line yourself:
-
-[source,ruby]
-------------------------------------
-$ gem install ecs-logging
-------------------------------------
-
-Then configure the client to use the logger:
-[source,ruby]
-------------------------------------
-require 'ecs_logging/logger'
-require 'elasticsearch'
-
-logger = EcsLogging::Logger.new($stdout)
-client = Elasticsearch::Client.new(logger: logger)
-> client.info
-{"@timestamp":"2022-07-12T05:31:18.590Z","log.level":"INFO","message":"GET http://localhost:9200/ [status:200, request:0.009s, query:n/a]","ecs.version":"1.4.0"}...
-------------------------------------
-
-See https://www.elastic.co/guide/en/ecs-logging/ruby/current/index.html[ECS Logging Ruby Reference] for more information on how to configure the logger.
diff --git a/docs/examples.asciidoc b/docs/examples.asciidoc
deleted file mode 100644
index 49afcaf3a5..0000000000
--- a/docs/examples.asciidoc
+++ /dev/null
@@ -1,226 +0,0 @@
-[[examples]]
-== Examples
-
-Below you can find examples of how to use the most frequently called APIs with
-the Ruby client.
-
-* <>
-* <>
-* <>
-* <>
-* <>
-* <>
-* <>
-* <>
-* <>
-
-
-[discrete]
-[[ex-index]]
-=== Indexing a document
-
-Let's index a document with the following fields: `name`, `author`,
-`release_date`, and `page_count`:
-
-```ruby
-body = {
- name: "The Hitchhiker's Guide to the Galaxy",
- author: "Douglas Adams",
- release_date: "1979-10-12",
- page_count: 180
-}
-
-client.index(index: 'books', body: body)
-```
-
-
-[discrete]
-[[ex-get]]
-=== Getting a document
-
-You can get a document by ID:
-
-```ruby
-id = 'l7LRjXgB2_ry9btNEv_V'
-client.get(index: 'books', id: id)
-```
-
-
-[discrete]
-[[ex-update]]
-=== Updating a document
-
-Assume you have the following document:
-
-```ruby
-book = {"name": "Foundation", "author": "Isaac Asimov", "release_date": "1951-06-01", "page_count": 224}
-```
-
-You can update the document by using the following script:
-
-```ruby
-response = client.index(index: 'books', body: book)
-id = response['_id']
-client.update(index: 'books', id: id, body: { doc: { page_count: 225 } })
-```
-
-
-[discrete]
-[[ex-delete]]
-=== Deleting a document
-
-You can delete a document by ID:
-
-```ruby
-id = 'l7LRjXgB2_ry9btNEv_V'
-client.delete(index: 'books', id: id)
-```
-
-
-[discrete]
-[[ex-bulk]]
-=== Bulk requests
-
-The `bulk` operation of the client supports various different formats of the
-payload: array of strings, header/data pairs, or the combined format where data
-is passed along with the header in a single item in a custom `:data` key.
-
-Index several documents in one request:
-
-```ruby
-body = [
- { index: { _index: 'books', _id: '42' } },
- { name: "The Hitchhiker's Guide to the Galaxy", author: 'Douglas Adams', release_date: '1979-10-12', page_count: 180},
- { index: { _index: 'books', _id: '43' } },
- { name: 'Snow Crash', author: 'Neal Stephenson', release_date: '1992-06-01', page_count: 470 },
- { index: { _index: 'books', _id: '44' } },
- { name: 'Starship Troopers', author: 'Robert A. Heinlein', release_date: '1959-12-01', page_count: 335}
-]
-client.bulk(body: body)
-```
-
-Delete several documents:
-
-```ruby
-body = [
- { delete: { _index: 'books', _id: '42' } },
- { delete: { _index: 'books', _id: '43' } },
-]
-client.bulk(body: body)
-```
-
-As mentioned, you can perform several operations in a single request with the
-combined format passing data in the `:data` option:
-
-```ruby
-body = [
- { index: { _index: 'books', _id: 45, data: { name: '1984', author: 'George Orwell', release_date: '1985-06-01', page_count: 328 } } },
- { update: { _index: 'books', _id: 43, data: { doc: { page_count: 471 } } } },
- { delete: { _index: 'books', _id: 44 } }
-]
-client.bulk(body: body)
-```
-
-
-[discrete]
-[[ex-search]]
-=== Searching for a document
-
-This example uses the same data that is used in the
-https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html#find-structure-example-nld-json[Find structure API documentation].
-
-First, bulk index it:
-
-[source,ruby]
-----
-body = [
- { index: { _index: 'books', data: {name: "Leviathan Wakes", "author": "James S.A. Corey", "release_date": "2011-06-02", "page_count": 561} } },
- { index: { _index: 'books', data: {name: "Hyperion", "author": "Dan Simmons", "release_date": "1989-05-26", "page_count": 482} } },
- { index: { _index: 'books', data: {name: "Dune", "author": "Frank Herbert", "release_date": "1965-06-01", "page_count": 604} } },
- { index: { _index: 'books', data: {name: "Dune Messiah", "author": "Frank Herbert", "release_date": "1969-10-15", "page_count": 331} } },
- { index: { _index: 'books', data: {name: "Children of Dune", "author": "Frank Herbert", "release_date": "1976-04-21", "page_count": 408} } },
- { index: { _index: 'books', data: {name: "God Emperor of Dune", "author": "Frank Herbert", "release_date": "1981-05-28", "page_count": 454} } },
- { index: { _index: 'books', data: {name: "Consider Phlebas", "author": "Iain M. Banks", "release_date": "1987-04-23", "page_count": 471} } },
- { index: { _index: 'books', data: {name: "Pandora's Star", "author": "Peter F. Hamilton", "release_date": "2004-03-02", "page_count": 768} } },
- { index: { _index: 'books', data: {name: "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585} } },
- { index: { _index: 'books', data: {name: "A Fire Upon the Deep", "author": "Vernor Vinge", "release_date": "1992-06-01", "page_count": 613} } },
- { index: { _index: 'books', data: {name: "Ender's Game", "author": "Orson Scott Card", "release_date": "1985-06-01", "page_count": 324} } },
- { index: { _index: 'books', data: {name: "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328} } },
- { index: { _index: 'books', data: {name: "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227} } },
- { index: { _index: 'books', data: {name: "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268} } },
- { index: { _index: 'books', data: {name: "Foundation", "author": "Isaac Asimov", "release_date": "1951-06-01", "page_count": 224} } },
- { index: { _index: 'books', data: {name: "The Giver", "author": "Lois Lowry", "release_date": "1993-04-26", "page_count": 208} } },
- { index: { _index: 'books', data: {name: "Slaughterhouse-Five", "author": "Kurt Vonnegut", "release_date": "1969-06-01", "page_count": 275} } },
- { index: { _index: 'books', data: {name: "The Hitchhiker's Guide to the Galaxy", "author": "Douglas Adams", "release_date": "1979-10-12", "page_count": 180} } },
- { index: { _index: 'books', data: {name: "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470} } },
- { index: { _index: 'books', data: {name: "Neuromancer", "author": "William Gibson", "release_date": "1984-07-01", "page_count": 271} } },
- { index: { _index: 'books', data: {name: "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311} } },
- { index: { _index: 'books', data: {name: "Starship Troopers", "author": "Robert A. Heinlein", "release_date": "1959-12-01", "page_count": 335} } },
- { index: { _index: 'books', data: {name: "The Left Hand of Darkness", "author": "Ursula K. Le Guin", "release_date": "1969-06-01", "page_count": 304} } },
- { index: { _index: 'books', data: {name: "The Moon is a Harsh Mistress", "author": "Robert A. Heinlein", "release_date": "1966-04-01", "page_count": 288 } } }
-]
-client.bulk(body: body)
-----
-
-The `field` parameter is a common parameter, so it can be passed in directly in
-the following way:
-
-```ruby
-client.search(index: 'books', q: 'dune')
-```
-
-You can do the same by using body request parameters:
-
-```ruby
-client.search(index: 'books', q: 'dune', body: { fields: [{ field: 'name' }] })
-response = client.search(index: 'books', body: { size: 15 })
-response['hits']['hits'].count # => 15
-```
-
-
-[discrete]
-[[ex-multisearch]]
-=== Multi search
-The following example shows how to perform a multisearch API call on `books` index:
-```ruby
-body = [
- {},
- {query: {range: {page_count: {gte: 100}}}},
- {},
- {query: {range: {page_count: {lte: 100}}}}
-]
-client.msearch(index:'books', body: body)
-```
-
-[discrete]
-[[ex-scroll]]
-=== Scrolling
-
-Submit a search API request that includes an argument for the scroll query
-parameter, save the search ID, then print out the book names you found:
-
-```ruby
-# Search request with a scroll argument:
-response = client.search(index: 'books', scroll: '10m')
-
-# Save the scroll id:
-scroll_id = response['_scroll_id']
-
-# Print out the names of all the books we find:
-while response['hits']['hits'].size.positive?
- response = client.scroll(scroll: '5m', body: { scroll_id: scroll_id })
- puts(response['hits']['hits'].map { |r| r['_source']['name'] })
-end
-```
-
-
-[discrete]
-[[ex-reindex]]
-=== Reindexing
-
-The following example shows how to reindex the `books` index into a new index
-called `books-reindexed`:
-
-```ruby
-client.reindex(body: {source: { index: 'books'}, dest: {index: 'books-reindexed' } })
-```
diff --git a/docs/examples/apm/screenshot.jpg b/docs/examples/apm/screenshot.jpg
deleted file mode 100644
index 6ba778dfb5..0000000000
Binary files a/docs/examples/apm/screenshot.jpg and /dev/null differ
diff --git a/docs/examples/guide/0091fc75271b1fbbd4269622a4881e8b.asciidoc b/docs/examples/guide/0091fc75271b1fbbd4269622a4881e8b.asciidoc
index ece3af94cb..5a97c4fcb7 100644
--- a/docs/examples/guide/0091fc75271b1fbbd4269622a4881e8b.asciidoc
+++ b/docs/examples/guide/0091fc75271b1fbbd4269622a4881e8b.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "http.clientip": '40.135.0.0'
+ 'http.clientip' => '40.135.0.0'
}
},
fields: [
diff --git a/docs/examples/guide/01c0e302f4fd5118faf5e34f4a010ebf.asciidoc b/docs/examples/guide/01c0e302f4fd5118faf5e34f4a010ebf.asciidoc
deleted file mode 100644
index d021935d69..0000000000
--- a/docs/examples/guide/01c0e302f4fd5118faf5e34f4a010ebf.asciidoc
+++ /dev/null
@@ -1,12 +0,0 @@
-[source, ruby]
-----
-response = client.indices.put_settings(
- index: 'my_source_index',
- body: {
- settings: {
- "index.blocks.write": true
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/02b6aa3e5652839f03de3a655854b897.asciidoc b/docs/examples/guide/02b6aa3e5652839f03de3a655854b897.asciidoc
new file mode 100644
index 0000000000..262aa3d102
--- /dev/null
+++ b/docs/examples/guide/02b6aa3e5652839f03de3a655854b897.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-data-stream'
+)
+puts response
+----
diff --git a/docs/examples/guide/033838729cfb5d1a28d04f69ee78d924.asciidoc b/docs/examples/guide/033838729cfb5d1a28d04f69ee78d924.asciidoc
new file mode 100644
index 0000000000..9afab92f19
--- /dev/null
+++ b/docs/examples/guide/033838729cfb5d1a28d04f69ee78d924.asciidoc
@@ -0,0 +1,41 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'Polygon',
+ orientation: 'LEFT',
+ coordinates: [
+ [
+ [
+ -177,
+ 10
+ ],
+ [
+ 176,
+ 15
+ ],
+ [
+ 172,
+ 0
+ ],
+ [
+ 176,
+ -15
+ ],
+ [
+ -177,
+ -10
+ ],
+ [
+ -177,
+ 10
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/0350410d11579f4e876c798ce1eaef5b.asciidoc b/docs/examples/guide/0350410d11579f4e876c798ce1eaef5b.asciidoc
new file mode 100644
index 0000000000..4382f16605
--- /dev/null
+++ b/docs/examples/guide/0350410d11579f4e876c798ce1eaef5b.asciidoc
@@ -0,0 +1,33 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'my-index-000001',
+ id: 5,
+ refresh: true,
+ body: {
+ query: {
+ bool: {
+ should: [
+ {
+ match: {
+ message: {
+ query: 'Japanese art',
+ _name: 'query1'
+ }
+ }
+ },
+ {
+ match: {
+ message: {
+ query: 'Holand culture',
+ _name: 'query2'
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/04412d11783dac25b5fd2ec5407078a3.asciidoc b/docs/examples/guide/04412d11783dac25b5fd2ec5407078a3.asciidoc
new file mode 100644
index 0000000000..70b13f8c28
--- /dev/null
+++ b/docs/examples/guide/04412d11783dac25b5fd2ec5407078a3.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.connector.update_api_key_id(
+ connector_id: 'my-connector',
+ body: {
+ api_key_id: 'my-api-key-id',
+ api_key_secret_id: 'my-connector-secret-id'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/0502284d4685c478eb68761f979f4303.asciidoc b/docs/examples/guide/0502284d4685c478eb68761f979f4303.asciidoc
index 9e21512aee..3a918f0cf8 100644
--- a/docs/examples/guide/0502284d4685c478eb68761f979f4303.asciidoc
+++ b/docs/examples/guide/0502284d4685c478eb68761f979f4303.asciidoc
@@ -8,7 +8,7 @@ response = client.ml.evaluate_data_frame(
filter: [
{
term: {
- "ml.is_training": false
+ 'ml.is_training' => false
}
}
]
diff --git a/docs/examples/guide/0514111513bb21f69a40c6258573264f.asciidoc b/docs/examples/guide/0514111513bb21f69a40c6258573264f.asciidoc
deleted file mode 100644
index 0eb49a4320..0000000000
--- a/docs/examples/guide/0514111513bb21f69a40c6258573264f.asciidoc
+++ /dev/null
@@ -1,19 +0,0 @@
-[source, ruby]
-----
-response = client.cluster.put_settings(
- body: {
- persistent: {
- cluster: {
- remote: {
- cluster_one: {
- seeds: [
- '127.0.0.1:9300'
- ]
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/05500e77aef581d92f6c605f7a48f7df.asciidoc b/docs/examples/guide/05500e77aef581d92f6c605f7a48f7df.asciidoc
new file mode 100644
index 0000000000..08bd3515c9
--- /dev/null
+++ b/docs/examples/guide/05500e77aef581d92f6c605f7a48f7df.asciidoc
@@ -0,0 +1,36 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'polygon',
+ coordinates: [
+ [
+ [
+ 1000,
+ -1001
+ ],
+ [
+ 1001,
+ -1001
+ ],
+ [
+ 1001,
+ -1000
+ ],
+ [
+ 1000,
+ -1000
+ ],
+ [
+ 1000,
+ -1001
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/05a09078fe1016e900e445ad4039cf97.asciidoc b/docs/examples/guide/05a09078fe1016e900e445ad4039cf97.asciidoc
new file mode 100644
index 0000000000..3456e7448c
--- /dev/null
+++ b/docs/examples/guide/05a09078fe1016e900e445ad4039cf97.asciidoc
@@ -0,0 +1,81 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'clientips',
+ body: {
+ mappings: {
+ properties: {
+ client_ip: {
+ type: 'keyword'
+ },
+ env: {
+ type: 'keyword'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.bulk(
+ index: 'clientips',
+ body: [
+ {
+ index: {}
+ },
+ {
+ client_ip: '172.21.0.5',
+ env: 'Development'
+ },
+ {
+ index: {}
+ },
+ {
+ client_ip: '172.21.2.113',
+ env: 'QA'
+ },
+ {
+ index: {}
+ },
+ {
+ client_ip: '172.21.2.162',
+ env: 'QA'
+ },
+ {
+ index: {}
+ },
+ {
+ client_ip: '172.21.3.15',
+ env: 'Production'
+ },
+ {
+ index: {}
+ },
+ {
+ client_ip: '172.21.3.16',
+ env: 'Production'
+ }
+ ]
+)
+puts response
+
+response = client.enrich.put_policy(
+ name: 'clientip_policy',
+ body: {
+ match: {
+ indices: 'clientips',
+ match_field: 'client_ip',
+ enrich_fields: [
+ 'env'
+ ]
+ }
+ }
+)
+puts response
+
+response = client.enrich.execute_policy(
+ name: 'clientip_policy',
+ wait_for_completion: false
+)
+puts response
+----
diff --git a/docs/examples/guide/06d65e3505dcb306977185e8545cf4a8.asciidoc b/docs/examples/guide/06d65e3505dcb306977185e8545cf4a8.asciidoc
index e6935f0668..8ea30df5e7 100644
--- a/docs/examples/guide/06d65e3505dcb306977185e8545cf4a8.asciidoc
+++ b/docs/examples/guide/06d65e3505dcb306977185e8545cf4a8.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.total_shards_per_node": 400
+ 'cluster.routing.allocation.total_shards_per_node' => 400
}
}
)
diff --git a/docs/examples/guide/070cf72783cfe534a04f2f64e4016052.asciidoc b/docs/examples/guide/070cf72783cfe534a04f2f64e4016052.asciidoc
index d5d2d06587..c9cd446c1f 100644
--- a/docs/examples/guide/070cf72783cfe534a04f2f64e4016052.asciidoc
+++ b/docs/examples/guide/070cf72783cfe534a04f2f64e4016052.asciidoc
@@ -15,8 +15,8 @@ response = client.index(
id: 'metric_1',
body: {
time: '100ms',
- "time.min": '10ms',
- "time.max": '900ms'
+ 'time.min' => '10ms',
+ 'time.max' => '900ms'
}
)
puts response
diff --git a/docs/examples/guide/083e514297c09e91211f0d168aef1b0b.asciidoc b/docs/examples/guide/083e514297c09e91211f0d168aef1b0b.asciidoc
index c2a75d4461..12732cfa40 100644
--- a/docs/examples/guide/083e514297c09e91211f0d168aef1b0b.asciidoc
+++ b/docs/examples/guide/083e514297c09e91211f0d168aef1b0b.asciidoc
@@ -5,7 +5,7 @@ response = client.update_by_query(
body: {
query: {
match: {
- "event.sequence": '97'
+ 'event.sequence' => '97'
}
},
script: {
diff --git a/docs/examples/guide/086ec4c5d86bbf80fb80162e94037689.asciidoc b/docs/examples/guide/086ec4c5d86bbf80fb80162e94037689.asciidoc
new file mode 100644
index 0000000000..66813eba78
--- /dev/null
+++ b/docs/examples/guide/086ec4c5d86bbf80fb80162e94037689.asciidoc
@@ -0,0 +1,48 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ query: {
+ weighted_tokens: {
+ query_expansion_field: {
+ tokens: {
+ "2161": 0.4679,
+ "2621": 0.307,
+ "2782": 0.1299,
+ "2851": 0.1056,
+ "3088": 0.3041,
+ "3376": 0.1038,
+ "3467": 0.4873,
+ "3684": 0.8958,
+ "4380": 0.334,
+ "4542": 0.4636,
+ "4633": 2.2805,
+ "4785": 1.2628,
+ "4860": 1.0655,
+ "5133": 1.0709,
+ "7139": 1.0016,
+ "7224": 0.2486,
+ "7387": 0.0985,
+ "7394": 0.0542,
+ "8915": 0.369,
+ "9156": 2.8947,
+ "10505": 0.2771,
+ "11464": 0.3996,
+ "13525": 0.0088,
+ "14178": 0.8161,
+ "16893": 0.1376,
+ "17851": 1.5348,
+ "19939": 0.6012
+ },
+ pruning_config: {
+ tokens_freq_ratio_threshold: 5,
+ tokens_weight_threshold: 0.4,
+ only_score_pruned_tokens: false
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/08f20902821a4f7a73ce7b959c5bdbdc.asciidoc b/docs/examples/guide/08f20902821a4f7a73ce7b959c5bdbdc.asciidoc
new file mode 100644
index 0000000000..b09f73849c
--- /dev/null
+++ b/docs/examples/guide/08f20902821a4f7a73ce7b959c5bdbdc.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ query: {
+ regexp: {
+ 'user.id' => {
+ value: 'k.*y',
+ flags: 'ALL',
+ case_insensitive: true,
+ max_determinized_states: 10_000,
+ rewrite: 'constant_score_blended'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/091200b658023db31dffc2f08a85a9cc.asciidoc b/docs/examples/guide/091200b658023db31dffc2f08a85a9cc.asciidoc
index ab4f18e035..2978aa101a 100644
--- a/docs/examples/guide/091200b658023db31dffc2f08a85a9cc.asciidoc
+++ b/docs/examples/guide/091200b658023db31dffc2f08a85a9cc.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.put_settings(
index: 'my-index-000001',
body: {
index: {
- "routing.allocation.total_shards_per_node": -1
+ 'routing.allocation.total_shards_per_node' => -1
}
}
)
diff --git a/docs/examples/guide/0957bbd535f58c97b12ffba90813d64c.asciidoc b/docs/examples/guide/0957bbd535f58c97b12ffba90813d64c.asciidoc
index 0378daa07e..f5c1386805 100644
--- a/docs/examples/guide/0957bbd535f58c97b12ffba90813d64c.asciidoc
+++ b/docs/examples/guide/0957bbd535f58c97b12ffba90813d64c.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.create(
index: 'analyze_sample',
body: {
settings: {
- "index.analyze.max_token_count": 20_000
+ 'index.analyze.max_token_count' => 20_000
}
}
)
diff --git a/docs/examples/guide/09a478fe32a7b7d814083ffa5297bcdf.asciidoc b/docs/examples/guide/09a478fe32a7b7d814083ffa5297bcdf.asciidoc
index 6829a3b96c..9b1e738eab 100644
--- a/docs/examples/guide/09a478fe32a7b7d814083ffa5297bcdf.asciidoc
+++ b/docs/examples/guide/09a478fe32a7b7d814083ffa5297bcdf.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
fuzzy: {
- "user.id": {
+ 'user.id' => {
value: 'ki'
}
}
diff --git a/docs/examples/guide/09bdf9a7e22733d668476724042a406c.asciidoc b/docs/examples/guide/09bdf9a7e22733d668476724042a406c.asciidoc
index 062b985eee..b4cb5b0eba 100644
--- a/docs/examples/guide/09bdf9a7e22733d668476724042a406c.asciidoc
+++ b/docs/examples/guide/09bdf9a7e22733d668476724042a406c.asciidoc
@@ -11,7 +11,7 @@ response = client.indices.put_index_template(
settings: {
number_of_shards: 1,
number_of_replicas: 1,
- "index.lifecycle.name": 'timeseries_policy'
+ 'index.lifecycle.name' => 'timeseries_policy'
}
}
}
diff --git a/docs/examples/guide/0a3003fa5af850e415634b50b1029859.asciidoc b/docs/examples/guide/0a3003fa5af850e415634b50b1029859.asciidoc
index 014354e582..90fe82158f 100644
--- a/docs/examples/guide/0a3003fa5af850e415634b50b1029859.asciidoc
+++ b/docs/examples/guide/0a3003fa5af850e415634b50b1029859.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
query: {
match: {
- "event.sequence": '97'
+ 'event.sequence' => '97'
}
}
}
diff --git a/docs/examples/guide/0a84c5b7c0793be745b13eaf13e94422.asciidoc b/docs/examples/guide/0a84c5b7c0793be745b13eaf13e94422.asciidoc
index 4a2f27239d..ebbfac8bd3 100644
--- a/docs/examples/guide/0a84c5b7c0793be745b13eaf13e94422.asciidoc
+++ b/docs/examples/guide/0a84c5b7c0793be745b13eaf13e94422.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.put_settings(
index: 'my-index-000001',
body: {
index: {
- "routing.allocation.total_shards_per_node": '2'
+ 'routing.allocation.total_shards_per_node' => '2'
}
}
)
diff --git a/docs/examples/guide/0ac5ec27c129b9541a6ddad6aeea1276.asciidoc b/docs/examples/guide/0ac5ec27c129b9541a6ddad6aeea1276.asciidoc
deleted file mode 100644
index bf807e3171..0000000000
--- a/docs/examples/guide/0ac5ec27c129b9541a6ddad6aeea1276.asciidoc
+++ /dev/null
@@ -1,20 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- body: {
- query: {
- fuzzy: {
- "user.id": {
- value: 'ki',
- fuzziness: 'AUTO',
- max_expansions: 50,
- prefix_length: 0,
- transpositions: true,
- rewrite: 'constant_score'
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/0ac9e7dd7e4acba51888256326ed5ffe.asciidoc b/docs/examples/guide/0ac9e7dd7e4acba51888256326ed5ffe.asciidoc
index 5cc10e6545..06e9740778 100644
--- a/docs/examples/guide/0ac9e7dd7e4acba51888256326ed5ffe.asciidoc
+++ b/docs/examples/guide/0ac9e7dd7e4acba51888256326ed5ffe.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
track_total_hits: true,
query: {
match: {
- "user.id": 'elkbee'
+ 'user.id' => 'elkbee'
}
}
}
diff --git a/docs/examples/guide/0b913fb9e010d877c0be015519cfddc6.asciidoc b/docs/examples/guide/0b913fb9e010d877c0be015519cfddc6.asciidoc
new file mode 100644
index 0000000000..89567134c6
--- /dev/null
+++ b/docs/examples/guide/0b913fb9e010d877c0be015519cfddc6.asciidoc
@@ -0,0 +1,39 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'my-index-000001',
+ body: {
+ "@timestamp": '2019-05-18T15:57:27.541Z',
+ ip: '225.44.217.191',
+ extension: 'jpg',
+ response: '200',
+ geo: {
+ coordinates: {
+ lat: 38.53146222,
+ lon: -121.7864906
+ }
+ },
+ url: 'https://media-for-the-masses.theacademyofperformingartsandscience.org/uploads/charles-fullerton.jpg'
+ }
+)
+puts response
+
+response = client.index(
+ index: 'my-index-000002',
+ body: {
+ "@timestamp": '2019-05-20T03:44:20.844Z',
+ ip: '198.247.165.49',
+ extension: 'php',
+ response: '200',
+ geo: {
+ coordinates: {
+ lat: 37.13189556,
+ lon: -76.4929875
+ }
+ },
+ memory: 241_720,
+ url: 'https://theacademyofperformingartsandscience.org/people/type:astronauts/name:laurel-b-clark/profile'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/0ba5acede9d43af424e85428e7d35420.asciidoc b/docs/examples/guide/0ba5acede9d43af424e85428e7d35420.asciidoc
new file mode 100644
index 0000000000..87819a64c9
--- /dev/null
+++ b/docs/examples/guide/0ba5acede9d43af424e85428e7d35420.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.ingest.put_pipeline(
+ id: 'azure_openai_embeddings',
+ body: {
+ processors: [
+ {
+ inference: {
+ model_id: 'azure_openai_embeddings',
+ input_output: {
+ input_field: 'content',
+ output_field: 'content_embedding'
+ }
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/0c7c40cd17985c3dd32aeaadbafc4fce.asciidoc b/docs/examples/guide/0c7c40cd17985c3dd32aeaadbafc4fce.asciidoc
new file mode 100644
index 0000000000..272df3e322
--- /dev/null
+++ b/docs/examples/guide/0c7c40cd17985c3dd32aeaadbafc4fce.asciidoc
@@ -0,0 +1,18 @@
+[source, ruby]
+----
+response = client.render_search_template(
+ body: {
+ source: {
+ query: {
+ match: {
+ message: '{{^name_exists}}Hello World{{/name_exists}}'
+ }
+ }
+ },
+ params: {
+ name_exists: false
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/0cee58617e75f493c5049d77be1c49f3.asciidoc b/docs/examples/guide/0cee58617e75f493c5049d77be1c49f3.asciidoc
new file mode 100644
index 0000000000..3a25f0bc33
--- /dev/null
+++ b/docs/examples/guide/0cee58617e75f493c5049d77be1c49f3.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ query: {
+ fuzzy: {
+ 'user.id' => {
+ value: 'ki',
+ fuzziness: 'AUTO',
+ max_expansions: 50,
+ prefix_length: 0,
+ transpositions: true,
+ rewrite: 'constant_score_blended'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/0cf29da4b9f0503bd1a79bdc883aadbc.asciidoc b/docs/examples/guide/0cf29da4b9f0503bd1a79bdc883aadbc.asciidoc
index f962665195..642fe40df3 100644
--- a/docs/examples/guide/0cf29da4b9f0503bd1a79bdc883aadbc.asciidoc
+++ b/docs/examples/guide/0cf29da4b9f0503bd1a79bdc883aadbc.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
size: 0,
body: {
runtime_mappings: {
- "grade.corrected": {
+ 'grade.corrected' => {
type: 'double',
script: {
source: "emit(Math.min(100, doc['grade'].value * params.correction))",
diff --git a/docs/examples/guide/0e83f140237d75469a428ff403564bb5.asciidoc b/docs/examples/guide/0e83f140237d75469a428ff403564bb5.asciidoc
index de32e24924..e81db18aed 100644
--- a/docs/examples/guide/0e83f140237d75469a428ff403564bb5.asciidoc
+++ b/docs/examples/guide/0e83f140237d75469a428ff403564bb5.asciidoc
@@ -3,10 +3,10 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.disk.watermark.low": '100gb',
- "cluster.routing.allocation.disk.watermark.high": '50gb',
- "cluster.routing.allocation.disk.watermark.flood_stage": '10gb',
- "cluster.info.update.interval": '1m'
+ 'cluster.routing.allocation.disk.watermark.low' => '100gb',
+ 'cluster.routing.allocation.disk.watermark.high' => '50gb',
+ 'cluster.routing.allocation.disk.watermark.flood_stage' => '10gb',
+ 'cluster.info.update.interval' => '1m'
}
}
)
diff --git a/docs/examples/guide/0eae571e9e1c40a40cb4b1c9530a8987.asciidoc b/docs/examples/guide/0eae571e9e1c40a40cb4b1c9530a8987.asciidoc
new file mode 100644
index 0000000000..de7c0517f8
--- /dev/null
+++ b/docs/examples/guide/0eae571e9e1c40a40cb4b1c9530a8987.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.ilm.migrate_to_data_tiers(
+ body: {
+ legacy_template_to_delete: 'global-template',
+ node_attribute: 'custom_attribute_name'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/0eccea755bd4f6dd47579a9022690546.asciidoc b/docs/examples/guide/0eccea755bd4f6dd47579a9022690546.asciidoc
new file mode 100644
index 0000000000..2a75495820
--- /dev/null
+++ b/docs/examples/guide/0eccea755bd4f6dd47579a9022690546.asciidoc
@@ -0,0 +1,18 @@
+[source, ruby]
+----
+response = client.cluster.put_settings(
+ body: {
+ persistent: {
+ cluster: {
+ remote: {
+ my_remote: {
+ mode: 'proxy',
+ proxy_address: 'my.remote.cluster.com:9443'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/0f2e5e006b663a88ee99b130ab1b4844.asciidoc b/docs/examples/guide/0f2e5e006b663a88ee99b130ab1b4844.asciidoc
index 2145ec81bf..f2fe2c785b 100644
--- a/docs/examples/guide/0f2e5e006b663a88ee99b130ab1b4844.asciidoc
+++ b/docs/examples/guide/0f2e5e006b663a88ee99b130ab1b4844.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
sort: [
{
_geo_distance: {
- "pin.location": [
+ 'pin.location' => [
[
-70,
40
diff --git a/docs/examples/guide/0f3a78296825d507dda6771f7ceb9d61.asciidoc b/docs/examples/guide/0f3a78296825d507dda6771f7ceb9d61.asciidoc
index f60ab0aad9..421f3f3b1f 100644
--- a/docs/examples/guide/0f3a78296825d507dda6771f7ceb9d61.asciidoc
+++ b/docs/examples/guide/0f3a78296825d507dda6771f7ceb9d61.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.exclude._ip": '10.0.0.1'
+ 'cluster.routing.allocation.exclude._ip' => '10.0.0.1'
}
}
)
diff --git a/docs/examples/guide/1070e59ba144cdf309fd9b2591612b95.asciidoc b/docs/examples/guide/1070e59ba144cdf309fd9b2591612b95.asciidoc
new file mode 100644
index 0000000000..d2d1d286e0
--- /dev/null
+++ b/docs/examples/guide/1070e59ba144cdf309fd9b2591612b95.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'test',
+ id: 3,
+ body: {
+ test: 'test'
+ }
+)
+puts response
+
+response = client.index(
+ index: 'test',
+ id: 4,
+ refresh: false,
+ body: {
+ test: 'test'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/10f0c8fed98455c460c374b50ffbb204.asciidoc b/docs/examples/guide/10f0c8fed98455c460c374b50ffbb204.asciidoc
new file mode 100644
index 0000000000..dc9a483dd8
--- /dev/null
+++ b/docs/examples/guide/10f0c8fed98455c460c374b50ffbb204.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.indices.rollover(
+ alias: 'dsl-data-stream'
+)
+puts response
+----
diff --git a/docs/examples/guide/1147a02afa087278e51fa365fb9e06b7.asciidoc b/docs/examples/guide/1147a02afa087278e51fa365fb9e06b7.asciidoc
new file mode 100644
index 0000000000..d72c72314b
--- /dev/null
+++ b/docs/examples/guide/1147a02afa087278e51fa365fb9e06b7.asciidoc
@@ -0,0 +1,9 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ size: '1000'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/11e8d6e14686efabb8634b6522c05cb5.asciidoc b/docs/examples/guide/11e8d6e14686efabb8634b6522c05cb5.asciidoc
index 55e6e14846..e7a9a68f0d 100644
--- a/docs/examples/guide/11e8d6e14686efabb8634b6522c05cb5.asciidoc
+++ b/docs/examples/guide/11e8d6e14686efabb8634b6522c05cb5.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
diff --git a/docs/examples/guide/1206539c3243681232cb134f4f89bed6.asciidoc b/docs/examples/guide/1206539c3243681232cb134f4f89bed6.asciidoc
deleted file mode 100644
index b936cf7090..0000000000
--- a/docs/examples/guide/1206539c3243681232cb134f4f89bed6.asciidoc
+++ /dev/null
@@ -1,42 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- index: 'sample-01*',
- body: {
- size: 0,
- aggregations: {
- tsid: {
- terms: {
- field: '_tsid'
- },
- aggregations: {
- over_time: {
- date_histogram: {
- field: '@timestamp',
- fixed_interval: '1d'
- },
- aggregations: {
- min: {
- min: {
- field: 'kubernetes.container.memory.usage.bytes'
- }
- },
- max: {
- max: {
- field: 'kubernetes.container.memory.usage.bytes'
- }
- },
- avg: {
- avg: {
- field: 'kubernetes.container.memory.usage.bytes'
- }
- }
- }
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/1295f51b9e5d4ba9987b02478146b50b.asciidoc b/docs/examples/guide/1295f51b9e5d4ba9987b02478146b50b.asciidoc
index 4fdef9f756..b544c7f2f3 100644
--- a/docs/examples/guide/1295f51b9e5d4ba9987b02478146b50b.asciidoc
+++ b/docs/examples/guide/1295f51b9e5d4ba9987b02478146b50b.asciidoc
@@ -2,7 +2,7 @@
----
response = client.indices.put_settings(
body: {
- "index.max_result_window": 5000
+ 'index.max_result_window' => 5000
}
)
puts response
@@ -10,8 +10,8 @@ puts response
response = client.cluster.put_settings(
body: {
persistent: {
- "search.max_buckets": 20_000,
- "search.allow_expensive_queries": false
+ 'search.max_buckets' => 20_000,
+ 'search.allow_expensive_queries' => false
}
}
)
diff --git a/docs/examples/guide/12cb1a87cdd0326cbe5affabdbf2ffe2.asciidoc b/docs/examples/guide/12cb1a87cdd0326cbe5affabdbf2ffe2.asciidoc
deleted file mode 100644
index f2bea9e76d..0000000000
--- a/docs/examples/guide/12cb1a87cdd0326cbe5affabdbf2ffe2.asciidoc
+++ /dev/null
@@ -1,7 +0,0 @@
-[source, ruby]
-----
-response = client.ilm.explain_lifecycle(
- index: 'my-index-000001'
-)
-puts response
-----
diff --git a/docs/examples/guide/1302e24b0476e0e9af7a2c890edf9f62.asciidoc b/docs/examples/guide/1302e24b0476e0e9af7a2c890edf9f62.asciidoc
index 996cd4e105..367c24ff6c 100644
--- a/docs/examples/guide/1302e24b0476e0e9af7a2c890edf9f62.asciidoc
+++ b/docs/examples/guide/1302e24b0476e0e9af7a2c890edf9f62.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
track_total_hits: false,
query: {
match: {
- "user.id": 'elkbee'
+ 'user.id' => 'elkbee'
}
}
}
diff --git a/docs/examples/guide/134384b8c63cfbd8d762fb01757bb3f9.asciidoc b/docs/examples/guide/134384b8c63cfbd8d762fb01757bb3f9.asciidoc
new file mode 100644
index 0000000000..d5811e51c1
--- /dev/null
+++ b/docs/examples/guide/134384b8c63cfbd8d762fb01757bb3f9.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'logs-debug',
+ body: {
+ date: '2019-12-12',
+ message: 'Starting up Elasticsearch',
+ level: 'debug'
+ }
+)
+puts response
+
+response = client.index(
+ index: 'logs-debug',
+ body: {
+ date: '2019-12-12',
+ message: 'Starting up Elasticsearch'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/13917f7cfb6a382c293275ff71134ec4.asciidoc b/docs/examples/guide/13917f7cfb6a382c293275ff71134ec4.asciidoc
new file mode 100644
index 0000000000..cac3d1e470
--- /dev/null
+++ b/docs/examples/guide/13917f7cfb6a382c293275ff71134ec4.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.render_search_template(
+ body: {
+ source: {
+ query: {
+ match: {
+ message: 'Hello {{#name_exists}}{{query_string}}{{/name_exists}}{{^name_exists}}World{{/name_exists}}'
+ }
+ }
+ },
+ params: {
+ query_string: 'Kimchy',
+ name_exists: true
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/13cc51ca3a783cdbb1f1d353eaedbf23.asciidoc b/docs/examples/guide/13cc51ca3a783cdbb1f1d353eaedbf23.asciidoc
index 44f54dc09e..4c2688cead 100644
--- a/docs/examples/guide/13cc51ca3a783cdbb1f1d353eaedbf23.asciidoc
+++ b/docs/examples/guide/13cc51ca3a783cdbb1f1d353eaedbf23.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "logger.org.elasticsearch.xpack.security.authc": 'debug'
+ 'logger.org.elasticsearch.xpack.security.authc' => 'debug'
}
}
)
diff --git a/docs/examples/guide/13d90ba227131aefbf4fcfd5992e662a.asciidoc b/docs/examples/guide/13d90ba227131aefbf4fcfd5992e662a.asciidoc
index fa36a229f4..5f5919e2a7 100644
--- a/docs/examples/guide/13d90ba227131aefbf4fcfd5992e662a.asciidoc
+++ b/docs/examples/guide/13d90ba227131aefbf4fcfd5992e662a.asciidoc
@@ -7,7 +7,7 @@ response = client.search(
should: [
{
match: {
- "name.first": {
+ 'name.first' => {
query: 'shay',
_name: 'first'
}
@@ -15,7 +15,7 @@ response = client.search(
},
{
match: {
- "name.last": {
+ 'name.last' => {
query: 'banon',
_name: 'last'
}
@@ -24,7 +24,7 @@ response = client.search(
],
filter: {
terms: {
- "name.last": [
+ 'name.last' => [
'banon',
'kimchy'
],
diff --git a/docs/examples/guide/13ecdf99114098c76b050397d9c3d4e6.asciidoc b/docs/examples/guide/13ecdf99114098c76b050397d9c3d4e6.asciidoc
new file mode 100644
index 0000000000..5972158dfe
--- /dev/null
+++ b/docs/examples/guide/13ecdf99114098c76b050397d9c3d4e6.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.inference.inference(
+ task_type: 'sparse_embedding',
+ inference_id: 'my-elser-model',
+ body: {
+ input: 'The sky above the port was the color of television tuned to a dead channel.'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/14a1db30e13eb1d03cfd9710ca847ebb.asciidoc b/docs/examples/guide/14a1db30e13eb1d03cfd9710ca847ebb.asciidoc
new file mode 100644
index 0000000000..0e7714c213
--- /dev/null
+++ b/docs/examples/guide/14a1db30e13eb1d03cfd9710ca847ebb.asciidoc
@@ -0,0 +1,23 @@
+[source, ruby]
+----
+response = client.bulk(
+ index: 'my-data-stream',
+ body: [
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2099-05-06T16:21:15.000Z',
+ message: '192.0.2.42 - - [06/May/2099:16:21:15 +0000] "GET /images/bg.jpg HTTP/1.0" 200 24736'
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2099-05-06T16:25:42.000Z',
+ message: '192.0.2.255 - - [06/May/2099:16:25:42 +0000] "GET /favicon.ico HTTP/1.0" 200 3638'
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/14afe65afee3d43f27aaaa5b37f26a31.asciidoc b/docs/examples/guide/14afe65afee3d43f27aaaa5b37f26a31.asciidoc
new file mode 100644
index 0000000000..5f446cbf10
--- /dev/null
+++ b/docs/examples/guide/14afe65afee3d43f27aaaa5b37f26a31.asciidoc
@@ -0,0 +1,16 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'Point',
+ coordinates: [
+ -77.03653,
+ 38.897676
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/154d703732daf5c5fcd0122e6a50213f.asciidoc b/docs/examples/guide/154d703732daf5c5fcd0122e6a50213f.asciidoc
index 7f90b03bb1..c148862c88 100644
--- a/docs/examples/guide/154d703732daf5c5fcd0122e6a50213f.asciidoc
+++ b/docs/examples/guide/154d703732daf5c5fcd0122e6a50213f.asciidoc
@@ -4,10 +4,10 @@ response = client.indices.put_mapping(
index: 'my-index-000001',
body: {
runtime: {
- "measures.start": {
+ 'measures.start' => {
type: 'long'
},
- "measures.end": {
+ 'measures.end' => {
type: 'long'
}
}
diff --git a/docs/examples/guide/156bc64c94f9f3334fbce25165d2286a.asciidoc b/docs/examples/guide/156bc64c94f9f3334fbce25165d2286a.asciidoc
index a56a0baf72..cb0e371518 100644
--- a/docs/examples/guide/156bc64c94f9f3334fbce25165d2286a.asciidoc
+++ b/docs/examples/guide/156bc64c94f9f3334fbce25165d2286a.asciidoc
@@ -5,8 +5,8 @@ response = client.indices.create(
body: {
settings: {
index: {
- "sort.field": 'date',
- "sort.order": 'desc'
+ 'sort.field' => 'date',
+ 'sort.order' => 'desc'
}
},
mappings: {
diff --git a/docs/examples/guide/165bebb9ce8b6babb72672db5b8b5976.asciidoc b/docs/examples/guide/165bebb9ce8b6babb72672db5b8b5976.asciidoc
deleted file mode 100644
index 7043cf07f8..0000000000
--- a/docs/examples/guide/165bebb9ce8b6babb72672db5b8b5976.asciidoc
+++ /dev/null
@@ -1,24 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'test_index',
- body: {
- settings: {
- index: {
- analysis: {
- filter: {
- synonym: {
- type: 'synonym',
- synonyms: [
- 'i-pod, i pod => ipod',
- 'universe, cosmos'
- ]
- }
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/16fc93f0e9a395d0668483d29e3df9d8.asciidoc b/docs/examples/guide/16fc93f0e9a395d0668483d29e3df9d8.asciidoc
new file mode 100644
index 0000000000..5a5410cf7f
--- /dev/null
+++ b/docs/examples/guide/16fc93f0e9a395d0668483d29e3df9d8.asciidoc
@@ -0,0 +1,35 @@
+[source, ruby]
+----
+response = client.bulk(
+ index: 'mv',
+ refresh: true,
+ body: [
+ {
+ index: {}
+ },
+ {
+ a: 1,
+ b: [
+ 2,
+ 1
+ ]
+ },
+ {
+ index: {}
+ },
+ {
+ a: 2,
+ b: 3
+ }
+ ]
+)
+puts response
+
+response = client.esql.query(
+ body: {
+ query: 'FROM mv | LIMIT 2',
+ version: '2024.04.01'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1736545c8b5674f6d311f3277eb387f1.asciidoc b/docs/examples/guide/1736545c8b5674f6d311f3277eb387f1.asciidoc
new file mode 100644
index 0000000000..2c07d094b6
--- /dev/null
+++ b/docs/examples/guide/1736545c8b5674f6d311f3277eb387f1.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.indices.put_data_lifecycle(
+ name: 'my-data-stream',
+ body: {
+ data_retention: '30d'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/17e6f3fac556f08a78f7a876e71acb89.asciidoc b/docs/examples/guide/17e6f3fac556f08a78f7a876e71acb89.asciidoc
index 419b4f0d93..914ab1e5ae 100644
--- a/docs/examples/guide/17e6f3fac556f08a78f7a876e71acb89.asciidoc
+++ b/docs/examples/guide/17e6f3fac556f08a78f7a876e71acb89.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.put_settings(
index: '_all',
body: {
settings: {
- "index.unassigned.node_left.delayed_timeout": '5m'
+ 'index.unassigned.node_left.delayed_timeout' => '5m'
}
}
)
diff --git a/docs/examples/guide/17fb298fb1e47f7d946a772d68f4e2df.asciidoc b/docs/examples/guide/17fb298fb1e47f7d946a772d68f4e2df.asciidoc
index c068872aba..b036ff9e74 100644
--- a/docs/examples/guide/17fb298fb1e47f7d946a772d68f4e2df.asciidoc
+++ b/docs/examples/guide/17fb298fb1e47f7d946a772d68f4e2df.asciidoc
@@ -5,7 +5,7 @@ response = client.delete_by_query(
body: {
query: {
match: {
- "user.id": 'vlb44hny'
+ 'user.id' => 'vlb44hny'
}
}
}
diff --git a/docs/examples/guide/186a7143d50e8c3ee01094e1a9ff0c0c.asciidoc b/docs/examples/guide/186a7143d50e8c3ee01094e1a9ff0c0c.asciidoc
new file mode 100644
index 0000000000..05ba3af0e9
--- /dev/null
+++ b/docs/examples/guide/186a7143d50e8c3ee01094e1a9ff0c0c.asciidoc
@@ -0,0 +1,35 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'passage_vectors',
+ body: {
+ mappings: {
+ properties: {
+ full_text: {
+ type: 'text'
+ },
+ creation_time: {
+ type: 'date'
+ },
+ paragraph: {
+ type: 'nested',
+ properties: {
+ vector: {
+ type: 'dense_vector',
+ dims: 2,
+ index_options: {
+ type: 'hnsw'
+ }
+ },
+ text: {
+ type: 'text',
+ index: false
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/197dc41c8df9629e145b3064c63b2ccc.asciidoc b/docs/examples/guide/197dc41c8df9629e145b3064c63b2ccc.asciidoc
deleted file mode 100644
index fbbb020028..0000000000
--- a/docs/examples/guide/197dc41c8df9629e145b3064c63b2ccc.asciidoc
+++ /dev/null
@@ -1,37 +0,0 @@
-[source, ruby]
-----
-response = client.bulk(
- index: 'customer',
- body: [
- {
- create: {}
- },
- {
- firstname: 'Monica',
- lastname: 'Rambeau'
- },
- {
- create: {}
- },
- {
- firstname: 'Carol',
- lastname: 'Danvers'
- },
- {
- create: {}
- },
- {
- firstname: 'Wanda',
- lastname: 'Maximoff'
- },
- {
- create: {}
- },
- {
- firstname: 'Jennifer',
- lastname: 'Takeda'
- }
- ]
-)
-puts response
-----
diff --git a/docs/examples/guide/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc b/docs/examples/guide/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc
new file mode 100644
index 0000000000..d7ed691180
--- /dev/null
+++ b/docs/examples/guide/19c00c6b29bc7dbc5e92b3668da2da93.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.simulate.ingest(
+ body: {
+ docs: [
+ {
+ _index: 'my-index',
+ _id: '123',
+ _source: {
+ foo: 'bar'
+ }
+ },
+ {
+ _index: 'my-index',
+ _id: '456',
+ _source: {
+ foo: 'rab'
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc b/docs/examples/guide/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc
new file mode 100644
index 0000000000..75b7f4fdaf
--- /dev/null
+++ b/docs/examples/guide/1aa96eeaf63fc967e166d1a2fcdccccc.asciidoc
@@ -0,0 +1,34 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index-000002',
+ body: {
+ mappings: {
+ properties: {
+ metrics: {
+ subobjects: false,
+ properties: {
+ time: {
+ type: 'object',
+ properties: {
+ min: {
+ type: 'long'
+ },
+ max: {
+ type: 'long'
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.indices.get_mapping(
+ index: 'my-index-000002'
+)
+puts response
+----
diff --git a/docs/examples/guide/1b5c8d6e61930a308008b5b1ace2aa07.asciidoc b/docs/examples/guide/1b5c8d6e61930a308008b5b1ace2aa07.asciidoc
index 6b69e350c7..6630104c85 100644
--- a/docs/examples/guide/1b5c8d6e61930a308008b5b1ace2aa07.asciidoc
+++ b/docs/examples/guide/1b5c8d6e61930a308008b5b1ace2aa07.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "manager.name": 'Alice White'
+ 'manager.name' => 'Alice White'
}
},
aggregations: {
diff --git a/docs/examples/guide/1c1f2a6a193d9e64c37242b2824b3031.asciidoc b/docs/examples/guide/1c1f2a6a193d9e64c37242b2824b3031.asciidoc
new file mode 100644
index 0000000000..f133387e99
--- /dev/null
+++ b/docs/examples/guide/1c1f2a6a193d9e64c37242b2824b3031.asciidoc
@@ -0,0 +1,56 @@
+[source, ruby]
+----
+response = client.cluster.put_component_template(
+ name: 'source_template',
+ body: {
+ template: {
+ settings: {
+ index: {
+ number_of_replicas: 2,
+ number_of_shards: 2,
+ mode: 'time_series',
+ routing_path: [
+ 'metricset'
+ ]
+ }
+ },
+ mappings: {
+ properties: {
+ "@timestamp": {
+ type: 'date'
+ },
+ metricset: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ "k8s": {
+ properties: {
+ tx: {
+ type: 'long'
+ },
+ rx: {
+ type: 'long'
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.indices.put_index_template(
+ name: 1,
+ body: {
+ index_patterns: [
+ 'k8s*'
+ ],
+ composed_of: [
+ 'source_template'
+ ],
+ data_stream: {}
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1c5a5a8c0bdc3c577f560157bd4e2313.asciidoc b/docs/examples/guide/1c5a5a8c0bdc3c577f560157bd4e2313.asciidoc
deleted file mode 100644
index d021935d69..0000000000
--- a/docs/examples/guide/1c5a5a8c0bdc3c577f560157bd4e2313.asciidoc
+++ /dev/null
@@ -1,12 +0,0 @@
-[source, ruby]
-----
-response = client.indices.put_settings(
- index: 'my_source_index',
- body: {
- settings: {
- "index.blocks.write": true
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/1cadbcf2cfeb312f73b7f098291356ac.asciidoc b/docs/examples/guide/1cadbcf2cfeb312f73b7f098291356ac.asciidoc
new file mode 100644
index 0000000000..034775dae3
--- /dev/null
+++ b/docs/examples/guide/1cadbcf2cfeb312f73b7f098291356ac.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'MULTIPOINT (102.0 2.0, 103.0 2.0)'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1cb3b45335ab1b9697c358104d44ea39.asciidoc b/docs/examples/guide/1cb3b45335ab1b9697c358104d44ea39.asciidoc
index fba8ebd60d..431f740523 100644
--- a/docs/examples/guide/1cb3b45335ab1b9697c358104d44ea39.asciidoc
+++ b/docs/examples/guide/1cb3b45335ab1b9697c358104d44ea39.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "xpack.security.transport.filter.enabled": false
+ 'xpack.security.transport.filter.enabled' => false
}
}
)
diff --git a/docs/examples/guide/1cd3b9d65576a9212eef898eb3105758.asciidoc b/docs/examples/guide/1cd3b9d65576a9212eef898eb3105758.asciidoc
index 56c6f0b69e..76116fcedb 100644
--- a/docs/examples/guide/1cd3b9d65576a9212eef898eb3105758.asciidoc
+++ b/docs/examples/guide/1cd3b9d65576a9212eef898eb3105758.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.enable": 'primaries'
+ 'cluster.routing.allocation.enable' => 'primaries'
}
}
)
diff --git a/docs/examples/guide/1ce2cbfe1430c8837c19304a6b648af3.asciidoc b/docs/examples/guide/1ce2cbfe1430c8837c19304a6b648af3.asciidoc
new file mode 100644
index 0000000000..ab0394bf90
--- /dev/null
+++ b/docs/examples/guide/1ce2cbfe1430c8837c19304a6b648af3.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.esql.query(
+ body: {
+ query: 'FROM mv | EVAL b + 2, a + b | LIMIT 4',
+ version: '2024.04.01'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1cfa04e9654c1484e3d4c75bf439400a.asciidoc b/docs/examples/guide/1cfa04e9654c1484e3d4c75bf439400a.asciidoc
new file mode 100644
index 0000000000..b12afda61e
--- /dev/null
+++ b/docs/examples/guide/1cfa04e9654c1484e3d4c75bf439400a.asciidoc
@@ -0,0 +1,58 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'polygon',
+ coordinates: [
+ [
+ [
+ 1000,
+ -1001
+ ],
+ [
+ 1001,
+ -1001
+ ],
+ [
+ 1001,
+ -1000
+ ],
+ [
+ 1000,
+ -1000
+ ],
+ [
+ 1000,
+ -1001
+ ]
+ ],
+ [
+ [
+ 1000.2,
+ -1001.2
+ ],
+ [
+ 1000.8,
+ -1001.2
+ ],
+ [
+ 1000.8,
+ -1001.8
+ ],
+ [
+ 1000.2,
+ -1001.8
+ ],
+ [
+ 1000.2,
+ -1001.2
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1d746272a7511bf91302a15b5c58ca0e.asciidoc b/docs/examples/guide/1d746272a7511bf91302a15b5c58ca0e.asciidoc
new file mode 100644
index 0000000000..91ad0a31e5
--- /dev/null
+++ b/docs/examples/guide/1d746272a7511bf91302a15b5c58ca0e.asciidoc
@@ -0,0 +1,23 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'passage_vectors',
+ body: {
+ fields: [
+ 'full_text',
+ 'creation_time'
+ ],
+ _source: false,
+ knn: {
+ query_vector: [
+ 0.45,
+ 45
+ ],
+ field: 'paragraph.vector',
+ k: 2,
+ num_candidates: 2
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1d918e206ad8dab916e59183da24d9ec.asciidoc b/docs/examples/guide/1d918e206ad8dab916e59183da24d9ec.asciidoc
index 0adff674d0..aa554fcd02 100644
--- a/docs/examples/guide/1d918e206ad8dab916e59183da24d9ec.asciidoc
+++ b/docs/examples/guide/1d918e206ad8dab916e59183da24d9ec.asciidoc
@@ -3,7 +3,7 @@
response = client.indices.put_settings(
index: '.watches',
body: {
- "index.routing.allocation.include.role": 'watcher'
+ 'index.routing.allocation.include.role' => 'watcher'
}
)
puts response
diff --git a/docs/examples/guide/1d9b695a17cffd910c496c9b03c75d6f.asciidoc b/docs/examples/guide/1d9b695a17cffd910c496c9b03c75d6f.asciidoc
new file mode 100644
index 0000000000..0bfbbe2d71
--- /dev/null
+++ b/docs/examples/guide/1d9b695a17cffd910c496c9b03c75d6f.asciidoc
@@ -0,0 +1,26 @@
+[source, ruby]
+----
+response = client.ilm.put_lifecycle(
+ policy: 'pre-dsl-ilm-policy',
+ body: {
+ policy: {
+ phases: {
+ hot: {
+ actions: {
+ rollover: {
+ max_primary_shard_size: '50gb'
+ }
+ }
+ },
+ delete: {
+ min_age: '7d',
+ actions: {
+ delete: {}
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1e94a2bb95bc245bcfb87ac7d611cf49.asciidoc b/docs/examples/guide/1e94a2bb95bc245bcfb87ac7d611cf49.asciidoc
new file mode 100644
index 0000000000..95b97b0d29
--- /dev/null
+++ b/docs/examples/guide/1e94a2bb95bc245bcfb87ac7d611cf49.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'latency',
+ body: {
+ size: 0,
+ aggregations: {
+ load_time_outlier: {
+ percentiles: {
+ field: 'load_time',
+ tdigest: {
+ execution_hint: 'high_accuracy'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1eb9c6ecb827ca69f7b17f7d2a26eae9.asciidoc b/docs/examples/guide/1eb9c6ecb827ca69f7b17f7d2a26eae9.asciidoc
index c4ccf60c50..a40eec98d0 100644
--- a/docs/examples/guide/1eb9c6ecb827ca69f7b17f7d2a26eae9.asciidoc
+++ b/docs/examples/guide/1eb9c6ecb827ca69f7b17f7d2a26eae9.asciidoc
@@ -5,7 +5,7 @@ response = client.render_search_template(
source: {
query: {
term: {
- "url.full": '{{#url}}{{host}}/{{page}}{{/url}}'
+ 'url.full' => '{{#url}}{{host}}/{{page}}{{/url}}'
}
}
},
diff --git a/docs/examples/guide/1ed77bf308fa4ab328b36060e412f500.asciidoc b/docs/examples/guide/1ed77bf308fa4ab328b36060e412f500.asciidoc
new file mode 100644
index 0000000000..fb386b3b81
--- /dev/null
+++ b/docs/examples/guide/1ed77bf308fa4ab328b36060e412f500.asciidoc
@@ -0,0 +1,91 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'metrics_index',
+ body: {
+ mappings: {
+ properties: {
+ network: {
+ properties: {
+ name: {
+ type: 'keyword'
+ }
+ }
+ },
+ latency_histo: {
+ type: 'histogram'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'metrics_index',
+ id: 1,
+ refresh: true,
+ body: {
+ 'network.name' => 'net-1',
+ latency_histo: {
+ values: [
+ 1,
+ 3,
+ 8,
+ 12,
+ 15
+ ],
+ counts: [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'metrics_index',
+ id: 2,
+ refresh: true,
+ body: {
+ 'network.name' => 'net-2',
+ latency_histo: {
+ values: [
+ 1,
+ 6,
+ 8,
+ 12,
+ 14
+ ],
+ counts: [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
+ }
+)
+puts response
+
+response = client.search(
+ index: 'metrics_index',
+ size: 0,
+ body: {
+ aggregations: {
+ latency_buckets: {
+ histogram: {
+ field: 'latency_histo',
+ interval: 5
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/1f507659757e2844cefced25848540a0.asciidoc b/docs/examples/guide/1f507659757e2844cefced25848540a0.asciidoc
index 360c711dde..4681d24d98 100644
--- a/docs/examples/guide/1f507659757e2844cefced25848540a0.asciidoc
+++ b/docs/examples/guide/1f507659757e2844cefced25848540a0.asciidoc
@@ -11,7 +11,7 @@ response = client.search(
filter: {
geo_distance: {
distance: '12km',
- "pin.location": [
+ 'pin.location' => [
-70,
40
]
diff --git a/docs/examples/guide/1f6a190fa1aade1fb66680388f184ef9.asciidoc b/docs/examples/guide/1f6a190fa1aade1fb66680388f184ef9.asciidoc
index e7ba65255b..4ab0f74b92 100644
--- a/docs/examples/guide/1f6a190fa1aade1fb66680388f184ef9.asciidoc
+++ b/docs/examples/guide/1f6a190fa1aade1fb66680388f184ef9.asciidoc
@@ -7,7 +7,7 @@ response = client.indices.validate_query(
body: {
query: {
match: {
- "user.id": {
+ 'user.id' => {
query: 'kimchy',
fuzziness: 'auto'
}
diff --git a/docs/examples/guide/1fcc4a3280be399753dcfd5c489ff682.asciidoc b/docs/examples/guide/1fcc4a3280be399753dcfd5c489ff682.asciidoc
new file mode 100644
index 0000000000..ba41c64e82
--- /dev/null
+++ b/docs/examples/guide/1fcc4a3280be399753dcfd5c489ff682.asciidoc
@@ -0,0 +1,34 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'idx',
+ body: {
+ mappings: {
+ _source: {
+ mode: 'synthetic'
+ },
+ properties: {
+ my_range: {
+ type: 'ip_range'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'idx',
+ id: 1,
+ body: {
+ my_range: [
+ '10.0.0.0/24',
+ {
+ gte: '10.0.0.0',
+ lte: '10.0.0.255'
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2009f2d1ba0780a799a0fdce889c9739.asciidoc b/docs/examples/guide/2009f2d1ba0780a799a0fdce889c9739.asciidoc
new file mode 100644
index 0000000000..c206fffad9
--- /dev/null
+++ b/docs/examples/guide/2009f2d1ba0780a799a0fdce889c9739.asciidoc
@@ -0,0 +1,64 @@
+[source, ruby]
+----
+response = client.bulk(
+ index: 'passage_vectors',
+ refresh: true,
+ body: [
+ {
+ index: {
+ _id: '1'
+ }
+ },
+ {
+ full_text: 'first paragraph another paragraph',
+ creation_time: '2019-05-04',
+ paragraph: [
+ {
+ vector: [
+ 0.45,
+ 45
+ ],
+ text: 'first paragraph',
+ paragraph_id: '1'
+ },
+ {
+ vector: [
+ 0.8,
+ 0.6
+ ],
+ text: 'another paragraph',
+ paragraph_id: '2'
+ }
+ ]
+ },
+ {
+ index: {
+ _id: '2'
+ }
+ },
+ {
+ full_text: 'number one paragraph number two paragraph',
+ creation_time: '2020-05-04',
+ paragraph: [
+ {
+ vector: [
+ 1.2,
+ 4.5
+ ],
+ text: 'number one paragraph',
+ paragraph_id: '1'
+ },
+ {
+ vector: [
+ -1,
+ 42
+ ],
+ text: 'number two paragraph',
+ paragraph_id: '2'
+ }
+ ]
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/20407c847adb8393ce41dc656384afc4.asciidoc b/docs/examples/guide/20407c847adb8393ce41dc656384afc4.asciidoc
new file mode 100644
index 0000000000..9d11ea16f9
--- /dev/null
+++ b/docs/examples/guide/20407c847adb8393ce41dc656384afc4.asciidoc
@@ -0,0 +1,37 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'passage_vectors',
+ body: {
+ fields: [
+ 'creation_time',
+ 'full_text'
+ ],
+ _source: false,
+ knn: {
+ query_vector: [
+ 0.45,
+ 45
+ ],
+ field: 'paragraph.vector',
+ k: 2,
+ num_candidates: 2,
+ filter: {
+ bool: {
+ filter: [
+ {
+ range: {
+ creation_time: {
+ gte: '2019-05-01',
+ lte: '2019-05-05'
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2051ffe025550ab6645bfd525eaed3c4.asciidoc b/docs/examples/guide/2051ffe025550ab6645bfd525eaed3c4.asciidoc
index ca39b7d159..237e9d305f 100644
--- a/docs/examples/guide/2051ffe025550ab6645bfd525eaed3c4.asciidoc
+++ b/docs/examples/guide/2051ffe025550ab6645bfd525eaed3c4.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
},
filter: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
top_left: 'POINT (-74.1 40.73)',
bottom_right: 'POINT (-71.12 40.01)'
}
diff --git a/docs/examples/guide/2081739da0c69de8af6f5bf9e94433e6.asciidoc b/docs/examples/guide/2081739da0c69de8af6f5bf9e94433e6.asciidoc
new file mode 100644
index 0000000000..ca8445843c
--- /dev/null
+++ b/docs/examples/guide/2081739da0c69de8af6f5bf9e94433e6.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'MULTILINESTRING ((102.0 2.0, 103.0 2.0, 103.0 3.0, 102.0 3.0), (100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.8))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/20e31b7ff08794bdf3c8f8ca3b796b1c.asciidoc b/docs/examples/guide/20e31b7ff08794bdf3c8f8ca3b796b1c.asciidoc
deleted file mode 100644
index 8b485f60f5..0000000000
--- a/docs/examples/guide/20e31b7ff08794bdf3c8f8ca3b796b1c.asciidoc
+++ /dev/null
@@ -1,11 +0,0 @@
-[source, ruby]
-----
-response = client.indices.downsample(
- index: 'sample-01',
- target_index: 'sample-01-downsample',
- body: {
- fixed_interval: '1h'
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/2155c920d7d860f3ee7542f2211b4fec.asciidoc b/docs/examples/guide/2155c920d7d860f3ee7542f2211b4fec.asciidoc
new file mode 100644
index 0000000000..f6c627b4bc
--- /dev/null
+++ b/docs/examples/guide/2155c920d7d860f3ee7542f2211b4fec.asciidoc
@@ -0,0 +1,16 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ query: {
+ text_expansion: {
+ "": {
+ model_id: 'the model to produce the token weights',
+ model_text: 'the query string'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/21d0ab6e420bfe7a1639db6af5b2e9c0.asciidoc b/docs/examples/guide/21d0ab6e420bfe7a1639db6af5b2e9c0.asciidoc
index a54d1256d5..649fd51ca7 100644
--- a/docs/examples/guide/21d0ab6e420bfe7a1639db6af5b2e9c0.asciidoc
+++ b/docs/examples/guide/21d0ab6e420bfe7a1639db6af5b2e9c0.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "rating.out_of_ten": {
+ 'rating.out_of_ten' => {
type: 'long',
script: {
source: "emit(doc['rating'].value * params.scaleFactor)",
diff --git a/docs/examples/guide/2224143c45dfc83a2d10b98cd4f94bb5.asciidoc b/docs/examples/guide/2224143c45dfc83a2d10b98cd4f94bb5.asciidoc
index 0a349c4918..6b26b2063b 100644
--- a/docs/examples/guide/2224143c45dfc83a2d10b98cd4f94bb5.asciidoc
+++ b/docs/examples/guide/2224143c45dfc83a2d10b98cd4f94bb5.asciidoc
@@ -11,7 +11,7 @@ response = client.search(
path: 'comments',
query: {
term: {
- "comments.author": 'nik9000'
+ 'comments.author' => 'nik9000'
}
}
}
diff --git a/docs/examples/guide/2238ac4170275f6cfc2af49c3f014cbc.asciidoc b/docs/examples/guide/2238ac4170275f6cfc2af49c3f014cbc.asciidoc
index 23fd8144ab..b56b0daa0e 100644
--- a/docs/examples/guide/2238ac4170275f6cfc2af49c3f014cbc.asciidoc
+++ b/docs/examples/guide/2238ac4170275f6cfc2af49c3f014cbc.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "grade.corrected": {
+ 'grade.corrected' => {
type: 'double',
script: {
source: "emit(Math.min(100, doc['grade'].value * params.correction))",
diff --git a/docs/examples/guide/22cb99d4e6ba3101a2d9f59764a90877.asciidoc b/docs/examples/guide/22cb99d4e6ba3101a2d9f59764a90877.asciidoc
new file mode 100644
index 0000000000..0408e0fdf8
--- /dev/null
+++ b/docs/examples/guide/22cb99d4e6ba3101a2d9f59764a90877.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'POINT (-77.03653 38.897676)'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/22dd833336fa22c8a8f67bb754ffba9a.asciidoc b/docs/examples/guide/22dd833336fa22c8a8f67bb754ffba9a.asciidoc
new file mode 100644
index 0000000000..fdce36bfd6
--- /dev/null
+++ b/docs/examples/guide/22dd833336fa22c8a8f67bb754ffba9a.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'azure-openai-embeddings',
+ body: {
+ knn: {
+ field: 'content_embedding',
+ query_vector_builder: {
+ text_embedding: {
+ model_id: 'azure_openai_embeddings',
+ model_text: 'Calculate fuel cost'
+ }
+ },
+ k: 10,
+ num_candidates: 100
+ },
+ _source: [
+ 'id',
+ 'content'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc b/docs/examples/guide/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc
new file mode 100644
index 0000000000..937d675bcd
--- /dev/null
+++ b/docs/examples/guide/2310d84ebf113f2a3ed14cc53172ae4a.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ query: {
+ text_expansion: {
+ 'ml.tokens' => {
+ model_id: '.elser_model_2',
+ model_text: 'How is the weather in Jamaica?'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/23af230e824f48b9cd56a4cf973d788c.asciidoc b/docs/examples/guide/23af230e824f48b9cd56a4cf973d788c.asciidoc
index affb5c4321..58424f15be 100644
--- a/docs/examples/guide/23af230e824f48b9cd56a4cf973d788c.asciidoc
+++ b/docs/examples/guide/23af230e824f48b9cd56a4cf973d788c.asciidoc
@@ -3,14 +3,14 @@
response = client.indices.put_settings(
index: 'my-index-000001',
body: {
- "index.search.slowlog.threshold.query.warn": '10s',
- "index.search.slowlog.threshold.query.info": '5s',
- "index.search.slowlog.threshold.query.debug": '2s',
- "index.search.slowlog.threshold.query.trace": '500ms',
- "index.search.slowlog.threshold.fetch.warn": '1s',
- "index.search.slowlog.threshold.fetch.info": '800ms',
- "index.search.slowlog.threshold.fetch.debug": '500ms',
- "index.search.slowlog.threshold.fetch.trace": '200ms'
+ 'index.search.slowlog.threshold.query.warn' => '10s',
+ 'index.search.slowlog.threshold.query.info' => '5s',
+ 'index.search.slowlog.threshold.query.debug' => '2s',
+ 'index.search.slowlog.threshold.query.trace' => '500ms',
+ 'index.search.slowlog.threshold.fetch.warn' => '1s',
+ 'index.search.slowlog.threshold.fetch.info' => '800ms',
+ 'index.search.slowlog.threshold.fetch.debug' => '500ms',
+ 'index.search.slowlog.threshold.fetch.trace' => '200ms'
}
)
puts response
diff --git a/docs/examples/guide/24ad3c234f69f55a3fbe2d488e70178a.asciidoc b/docs/examples/guide/24ad3c234f69f55a3fbe2d488e70178a.asciidoc
index 2a69b8cb1a..938c15b190 100644
--- a/docs/examples/guide/24ad3c234f69f55a3fbe2d488e70178a.asciidoc
+++ b/docs/examples/guide/24ad3c234f69f55a3fbe2d488e70178a.asciidoc
@@ -5,7 +5,7 @@ response = client.ml.evaluate_data_frame(
index: 'student_performance_mathematics_reg',
query: {
term: {
- "ml.is_training": {
+ 'ml.is_training' => {
value: true
}
}
diff --git a/docs/examples/guide/24d66b2ebdf662d8b03e17214e65c825.asciidoc b/docs/examples/guide/24d66b2ebdf662d8b03e17214e65c825.asciidoc
new file mode 100644
index 0000000000..e9e2c858ea
--- /dev/null
+++ b/docs/examples/guide/24d66b2ebdf662d8b03e17214e65c825.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.cluster.put_settings(
+ body: {
+ persistent: {
+ 'xpack.profiling.templates.enabled' => false
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/256eba7a77c8890a43afeda8ce8a3225.asciidoc b/docs/examples/guide/256eba7a77c8890a43afeda8ce8a3225.asciidoc
new file mode 100644
index 0000000000..f32c912892
--- /dev/null
+++ b/docs/examples/guide/256eba7a77c8890a43afeda8ce8a3225.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.ingest.put_pipeline(
+ id: 'my-text-embeddings-pipeline',
+ body: {
+ description: 'Text embedding pipeline',
+ processors: [
+ {
+ inference: {
+ model_id: 'sentence-transformers__msmarco-minilm-l-12-v3',
+ target_field: 'my_embeddings',
+ field_map: {
+ my_text_field: 'text_field'
+ }
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/25981b7b3d55b87e1484586d57b695b1.asciidoc b/docs/examples/guide/25981b7b3d55b87e1484586d57b695b1.asciidoc
new file mode 100644
index 0000000000..bb761bab2d
--- /dev/null
+++ b/docs/examples/guide/25981b7b3d55b87e1484586d57b695b1.asciidoc
@@ -0,0 +1,12 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'products',
+ id: 1567,
+ body: {
+ product: 'r2d2',
+ details: 'A resourceful astromech droid'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/25d40d3049e57e2bb70c2c5b88bd7b87.asciidoc b/docs/examples/guide/25d40d3049e57e2bb70c2c5b88bd7b87.asciidoc
index bd388c74e1..0f12f3a9aa 100644
--- a/docs/examples/guide/25d40d3049e57e2bb70c2c5b88bd7b87.asciidoc
+++ b/docs/examples/guide/25d40d3049e57e2bb70c2c5b88bd7b87.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.put_settings(
index: '_all',
body: {
settings: {
- "index.unassigned.node_left.delayed_timeout": '0'
+ 'index.unassigned.node_left.delayed_timeout' => '0'
}
}
)
diff --git a/docs/examples/guide/2646710ece0c4c843aebeacd370d0396.asciidoc b/docs/examples/guide/2646710ece0c4c843aebeacd370d0396.asciidoc
new file mode 100644
index 0000000000..d8d4796cc6
--- /dev/null
+++ b/docs/examples/guide/2646710ece0c4c843aebeacd370d0396.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-byte-quantized-index',
+ body: {
+ mappings: {
+ properties: {
+ my_vector: {
+ type: 'dense_vector',
+ dims: 3,
+ index: true,
+ index_options: {
+ type: 'int8_hnsw'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/27384266370152add76471dd0332a2f1.asciidoc b/docs/examples/guide/27384266370152add76471dd0332a2f1.asciidoc
index 81861484c5..ea187447aa 100644
--- a/docs/examples/guide/27384266370152add76471dd0332a2f1.asciidoc
+++ b/docs/examples/guide/27384266370152add76471dd0332a2f1.asciidoc
@@ -7,7 +7,7 @@ response = client.transform.update_transform(
index: 'kibana_sample_data_ecommerce',
query: {
term: {
- "geoip.continent_name": {
+ 'geoip.continent_name' => {
value: 'Asia'
}
}
diff --git a/docs/examples/guide/274feaaa727e0ddf61b3c0f093182839.asciidoc b/docs/examples/guide/274feaaa727e0ddf61b3c0f093182839.asciidoc
new file mode 100644
index 0000000000..7108c73033
--- /dev/null
+++ b/docs/examples/guide/274feaaa727e0ddf61b3c0f093182839.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index-000001',
+ body: {
+ runtime_mappings: {
+ duration: {
+ type: 'long',
+ script: {
+ source: "\n emit(doc['measures.end'].value - doc['measures.start'].value);\n "
+ }
+ }
+ },
+ aggregations: {
+ duration_stats: {
+ stats: {
+ field: 'duration'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/279e2b29261971999923fdc658bba8ff.asciidoc b/docs/examples/guide/279e2b29261971999923fdc658bba8ff.asciidoc
index 71610c2706..81c0dc4380 100644
--- a/docs/examples/guide/279e2b29261971999923fdc658bba8ff.asciidoc
+++ b/docs/examples/guide/279e2b29261971999923fdc658bba8ff.asciidoc
@@ -13,7 +13,7 @@ response = client.search(
},
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/27c22a152470e6a4c06e832731d9b77d.asciidoc b/docs/examples/guide/27c22a152470e6a4c06e832731d9b77d.asciidoc
deleted file mode 100644
index f7b0543284..0000000000
--- a/docs/examples/guide/27c22a152470e6a4c06e832731d9b77d.asciidoc
+++ /dev/null
@@ -1,8 +0,0 @@
-[source, ruby]
-----
-response = client.indices.add_block(
- index: 'sample-01',
- block: 'write'
-)
-puts response
-----
diff --git a/docs/examples/guide/28543836b62b5622a402e6f7731d68f0.asciidoc b/docs/examples/guide/28543836b62b5622a402e6f7731d68f0.asciidoc
new file mode 100644
index 0000000000..f2c56f82c0
--- /dev/null
+++ b/docs/examples/guide/28543836b62b5622a402e6f7731d68f0.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.indices.downsample(
+ index: '.ds-my-data-stream-2023.07.26-000001',
+ target_index: '.ds-my-data-stream-2023.07.26-000001-downsample',
+ body: {
+ fixed_interval: '1h'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2897ccc2a3bf3d0cd89328ee4413fae5.asciidoc b/docs/examples/guide/2897ccc2a3bf3d0cd89328ee4413fae5.asciidoc
new file mode 100644
index 0000000000..f1c4802004
--- /dev/null
+++ b/docs/examples/guide/2897ccc2a3bf3d0cd89328ee4413fae5.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.async_search.get(
+ id: 'FklQYndoTDJ2VEFlMEVBTzFJMGhJVFEaLVlKYndBWWZSMUdicUc4WVlEaFl4ZzoxNTU='
+)
+puts response
+----
diff --git a/docs/examples/guide/28ac880057135e46b3b00c7f3976538c.asciidoc b/docs/examples/guide/28ac880057135e46b3b00c7f3976538c.asciidoc
index 13d5773085..4f5df5b79b 100644
--- a/docs/examples/guide/28ac880057135e46b3b00c7f3976538c.asciidoc
+++ b/docs/examples/guide/28ac880057135e46b3b00c7f3976538c.asciidoc
@@ -3,7 +3,7 @@
response = client.indices.put_settings(
index: 'test',
body: {
- "index.routing.allocation.include._ip": '192.168.2.*'
+ 'index.routing.allocation.include._ip' => '192.168.2.*'
}
)
puts response
diff --git a/docs/examples/guide/28d3bb1dbed615c6e719d50d48ab6fb4.asciidoc b/docs/examples/guide/28d3bb1dbed615c6e719d50d48ab6fb4.asciidoc
deleted file mode 100644
index f72bfd4ab7..0000000000
--- a/docs/examples/guide/28d3bb1dbed615c6e719d50d48ab6fb4.asciidoc
+++ /dev/null
@@ -1,19 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- body: {
- query: {
- regexp: {
- "user.id": {
- value: 'k.*y',
- flags: 'ALL',
- case_insensitive: true,
- max_determinized_states: 10_000,
- rewrite: 'constant_score'
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/2988a112b590ae2320940887125fe36a.asciidoc b/docs/examples/guide/2988a112b590ae2320940887125fe36a.asciidoc
new file mode 100644
index 0000000000..b7074ac60d
--- /dev/null
+++ b/docs/examples/guide/2988a112b590ae2320940887125fe36a.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.esql.query(
+ body: {
+ query: 'FROM mv | EVAL b=MV_MIN(b) | EVAL b + 2, a + b | LIMIT 4',
+ version: '2024.04.01'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/29953082744b7a36e437b392a6391c81.asciidoc b/docs/examples/guide/29953082744b7a36e437b392a6391c81.asciidoc
new file mode 100644
index 0000000000..d8b66a0146
--- /dev/null
+++ b/docs/examples/guide/29953082744b7a36e437b392a6391c81.asciidoc
@@ -0,0 +1,13 @@
+[source, ruby]
+----
+response = client.render_search_template(
+ body: {
+ id: 'my-search-template',
+ params: {
+ from: 20,
+ size: 10
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2a71e2d7f7179dd76183d30789046808.asciidoc b/docs/examples/guide/2a71e2d7f7179dd76183d30789046808.asciidoc
new file mode 100644
index 0000000000..0abe51fb52
--- /dev/null
+++ b/docs/examples/guide/2a71e2d7f7179dd76183d30789046808.asciidoc
@@ -0,0 +1,27 @@
+[source, ruby]
+----
+response = client.bulk(
+ index: 'mv',
+ refresh: true,
+ body: [
+ {
+ index: {}
+ },
+ {
+ a: 1,
+ b: [
+ 2,
+ 1
+ ]
+ },
+ {
+ index: {}
+ },
+ {
+ a: 2,
+ b: 3
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/2a91e1fb8ad93a188fa9d77ec01bc431.asciidoc b/docs/examples/guide/2a91e1fb8ad93a188fa9d77ec01bc431.asciidoc
index f8943ea937..a7b1406e87 100644
--- a/docs/examples/guide/2a91e1fb8ad93a188fa9d77ec01bc431.asciidoc
+++ b/docs/examples/guide/2a91e1fb8ad93a188fa9d77ec01bc431.asciidoc
@@ -42,7 +42,7 @@ response = client.search(
path: 'comments',
query: {
match: {
- "comments.number": 2
+ 'comments.number' => 2
}
},
inner_hits: {}
diff --git a/docs/examples/guide/2afdf0d83724953aa2875b5fb37d60cc.asciidoc b/docs/examples/guide/2afdf0d83724953aa2875b5fb37d60cc.asciidoc
new file mode 100644
index 0000000000..f146aeb501
--- /dev/null
+++ b/docs/examples/guide/2afdf0d83724953aa2875b5fb37d60cc.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.esql.async_query_get(
+ id: 'FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=',
+ wait_for_completion_timeout: '30s'
+)
+puts response
+----
diff --git a/docs/examples/guide/2b1c560f00d9bcf5caaf56c03f6b5962.asciidoc b/docs/examples/guide/2b1c560f00d9bcf5caaf56c03f6b5962.asciidoc
new file mode 100644
index 0000000000..d9089312cf
--- /dev/null
+++ b/docs/examples/guide/2b1c560f00d9bcf5caaf56c03f6b5962.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.sync_job_list(
+ job_type: 'full,incremental'
+)
+puts response
+----
diff --git a/docs/examples/guide/2b23a0e5fc29fa57da48c50b41909951.asciidoc b/docs/examples/guide/2b23a0e5fc29fa57da48c50b41909951.asciidoc
deleted file mode 100644
index f61445c101..0000000000
--- a/docs/examples/guide/2b23a0e5fc29fa57da48c50b41909951.asciidoc
+++ /dev/null
@@ -1,31 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- body: {
- query: {
- span_near: {
- clauses: [
- {
- span_term: {
- text: 'quick brown'
- }
- },
- {
- span_field_masking: {
- query: {
- span_term: {
- "text.stems": 'fox'
- }
- },
- field: 'text'
- }
- }
- ],
- slop: 5,
- in_order: false
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/2b7687e3d7c06824950e00618c297864.asciidoc b/docs/examples/guide/2b7687e3d7c06824950e00618c297864.asciidoc
new file mode 100644
index 0000000000..ae52726b49
--- /dev/null
+++ b/docs/examples/guide/2b7687e3d7c06824950e00618c297864.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.indices.resolve_cluster(
+ name: 'my-index*,clust*:my-index*'
+)
+puts response
+----
diff --git a/docs/examples/guide/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc b/docs/examples/guide/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc
index da108df215..54e4427c94 100644
--- a/docs/examples/guide/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc
+++ b/docs/examples/guide/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc
@@ -3,8 +3,8 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.indices.close.enable": false,
- "indices.recovery.max_bytes_per_sec": '50mb'
+ 'cluster.indices.close.enable' => false,
+ 'indices.recovery.max_bytes_per_sec' => '50mb'
},
transient: {
"*": nil
diff --git a/docs/examples/guide/2bc1d52efec2076dc9fc2a3a2d90e8ab.asciidoc b/docs/examples/guide/2bc1d52efec2076dc9fc2a3a2d90e8ab.asciidoc
new file mode 100644
index 0000000000..854c43d58b
--- /dev/null
+++ b/docs/examples/guide/2bc1d52efec2076dc9fc2a3a2d90e8ab.asciidoc
@@ -0,0 +1,18 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'latency',
+ body: {
+ size: 0,
+ aggregations: {
+ load_time_boxplot: {
+ boxplot: {
+ field: 'load_time',
+ execution_hint: 'high_accuracy'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2c1e16e9ac24cfea979af2a69900d3c2.asciidoc b/docs/examples/guide/2c1e16e9ac24cfea979af2a69900d3c2.asciidoc
new file mode 100644
index 0000000000..574ab9bc24
--- /dev/null
+++ b/docs/examples/guide/2c1e16e9ac24cfea979af2a69900d3c2.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.synonyms.put_synonym_rule(
+ set_id: 'my-synonyms-set',
+ rule_id: 'test-1',
+ body: {
+ synonyms: 'hello, hi, howdy'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2c3207c0c985d253b2ecccc14e69e25a.asciidoc b/docs/examples/guide/2c3207c0c985d253b2ecccc14e69e25a.asciidoc
new file mode 100644
index 0000000000..fa59cec745
--- /dev/null
+++ b/docs/examples/guide/2c3207c0c985d253b2ecccc14e69e25a.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.indices.add_block(
+ index: '.ds-my-data-stream-2023.07.26-000001',
+ block: 'write'
+)
+puts response
+----
diff --git a/docs/examples/guide/2c3dff44904d3d73ff47f1afe89c7f86.asciidoc b/docs/examples/guide/2c3dff44904d3d73ff47f1afe89c7f86.asciidoc
index 9f4bfc6f90..18e0ef3c06 100644
--- a/docs/examples/guide/2c3dff44904d3d73ff47f1afe89c7f86.asciidoc
+++ b/docs/examples/guide/2c3dff44904d3d73ff47f1afe89c7f86.asciidoc
@@ -5,7 +5,7 @@ response = client.update_by_query(
body: {
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
max_docs: 1
diff --git a/docs/examples/guide/2da48241cfc21d2c57dc970845470bda.asciidoc b/docs/examples/guide/2da48241cfc21d2c57dc970845470bda.asciidoc
deleted file mode 100644
index 54e0e3e418..0000000000
--- a/docs/examples/guide/2da48241cfc21d2c57dc970845470bda.asciidoc
+++ /dev/null
@@ -1,46 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'my-index-000001',
- body: {
- mappings: {
- properties: {
- metrics: {
- type: 'object',
- subobjects: false
- }
- }
- }
- }
-)
-puts response
-
-response = client.index(
- index: 'my-index-000001',
- id: 'metric_1',
- body: {
- "metrics.time": 100,
- "metrics.time.min": 10,
- "metrics.time.max": 900
- }
-)
-puts response
-
-response = client.index(
- index: 'my-index-000001',
- id: 'metric_2',
- body: {
- metrics: {
- time: 100,
- "time.min": 10,
- "time.max": 900
- }
- }
-)
-puts response
-
-response = client.indices.get_mapping(
- index: 'my-index-000001'
-)
-puts response
-----
diff --git a/docs/examples/guide/2dad2b0c8ba503228f4b11cecca0b348.asciidoc b/docs/examples/guide/2dad2b0c8ba503228f4b11cecca0b348.asciidoc
new file mode 100644
index 0000000000..dcb81b2791
--- /dev/null
+++ b/docs/examples/guide/2dad2b0c8ba503228f4b11cecca0b348.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.indices.put_data_lifecycle(
+ name: 'dsl-data-stream',
+ body: {
+ data_retention: '7d'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2e3d1b293da93f2a9ecfc26786ec28d6.asciidoc b/docs/examples/guide/2e3d1b293da93f2a9ecfc26786ec28d6.asciidoc
new file mode 100644
index 0000000000..b86c696ba7
--- /dev/null
+++ b/docs/examples/guide/2e3d1b293da93f2a9ecfc26786ec28d6.asciidoc
@@ -0,0 +1,155 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'my-data-stream-template',
+ body: {
+ index_patterns: [
+ 'my-data-stream*'
+ ],
+ data_stream: {},
+ template: {
+ settings: {
+ index: {
+ mode: 'time_series',
+ routing_path: [
+ 'kubernetes.namespace',
+ 'kubernetes.host',
+ 'kubernetes.node',
+ 'kubernetes.pod'
+ ],
+ number_of_replicas: 0,
+ number_of_shards: 2
+ }
+ },
+ mappings: {
+ properties: {
+ "@timestamp": {
+ type: 'date'
+ },
+ kubernetes: {
+ properties: {
+ container: {
+ properties: {
+ cpu: {
+ properties: {
+ usage: {
+ properties: {
+ core: {
+ properties: {
+ ns: {
+ type: 'long'
+ }
+ }
+ },
+ limit: {
+ properties: {
+ pct: {
+ type: 'float'
+ }
+ }
+ },
+ nanocores: {
+ type: 'long',
+ time_series_metric: 'gauge'
+ },
+ node: {
+ properties: {
+ pct: {
+ type: 'float'
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ memory: {
+ properties: {
+ available: {
+ properties: {
+ bytes: {
+ type: 'long',
+ time_series_metric: 'gauge'
+ }
+ }
+ },
+ majorpagefaults: {
+ type: 'long'
+ },
+ pagefaults: {
+ type: 'long',
+ time_series_metric: 'gauge'
+ },
+ rss: {
+ properties: {
+ bytes: {
+ type: 'long',
+ time_series_metric: 'gauge'
+ }
+ }
+ },
+ usage: {
+ properties: {
+ bytes: {
+ type: 'long',
+ time_series_metric: 'gauge'
+ },
+ limit: {
+ properties: {
+ pct: {
+ type: 'float'
+ }
+ }
+ },
+ node: {
+ properties: {
+ pct: {
+ type: 'float'
+ }
+ }
+ }
+ }
+ },
+ workingset: {
+ properties: {
+ bytes: {
+ type: 'long',
+ time_series_metric: 'gauge'
+ }
+ }
+ }
+ }
+ },
+ name: {
+ type: 'keyword'
+ },
+ start_time: {
+ type: 'date'
+ }
+ }
+ },
+ host: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ namespace: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ node: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ pod: {
+ type: 'keyword',
+ time_series_dimension: true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2e796e5ca59768d4426abbf9a049db3e.asciidoc b/docs/examples/guide/2e796e5ca59768d4426abbf9a049db3e.asciidoc
index 797f96de6a..c83ca430f7 100644
--- a/docs/examples/guide/2e796e5ca59768d4426abbf9a049db3e.asciidoc
+++ b/docs/examples/guide/2e796e5ca59768d4426abbf9a049db3e.asciidoc
@@ -5,7 +5,7 @@ response = client.indices.split(
target: 'my_target_index',
body: {
settings: {
- "index.number_of_shards": 2
+ 'index.number_of_shards' => 2
}
}
)
diff --git a/docs/examples/guide/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc b/docs/examples/guide/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc
new file mode 100644
index 0000000000..5588366d70
--- /dev/null
+++ b/docs/examples/guide/2e93eaaebf75fa4a2451e8a76ffa9f20.asciidoc
@@ -0,0 +1,23 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'my-data-stream-template',
+ body: {
+ index_patterns: [
+ 'my-data-stream*'
+ ],
+ data_stream: {},
+ priority: 500,
+ template: {
+ mappings: {
+ properties: {
+ message: {
+ type: 'text'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2ebcdd00ccbf26b4c8e6d9c80dfb3d55.asciidoc b/docs/examples/guide/2ebcdd00ccbf26b4c8e6d9c80dfb3d55.asciidoc
new file mode 100644
index 0000000000..f6b8216d96
--- /dev/null
+++ b/docs/examples/guide/2ebcdd00ccbf26b4c8e6d9c80dfb3d55.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'linestring',
+ coordinates: [
+ [
+ -377.03653,
+ 389.897676
+ ],
+ [
+ -377.009051,
+ 389.889939
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc b/docs/examples/guide/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc
new file mode 100644
index 0000000000..bc4166eea6
--- /dev/null
+++ b/docs/examples/guide/2f07b81fd47ec3b074242a760f0c4e9e.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.indices.put_settings(
+ index: 'my-index-000001',
+ body: {
+ 'index.indexing.slowlog.include.user' => true
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2f4a55dfeba8851b306ef9c1b216ef54.asciidoc b/docs/examples/guide/2f4a55dfeba8851b306ef9c1b216ef54.asciidoc
index da26a701e8..a0314d9bd2 100644
--- a/docs/examples/guide/2f4a55dfeba8851b306ef9c1b216ef54.asciidoc
+++ b/docs/examples/guide/2f4a55dfeba8851b306ef9c1b216ef54.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
term: {
- "labels.release": 'v1.3.0'
+ 'labels.release' => 'v1.3.0'
}
}
}
diff --git a/docs/examples/guide/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc b/docs/examples/guide/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc
index a0a7aba7cb..1e58a61ba4 100644
--- a/docs/examples/guide/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc
+++ b/docs/examples/guide/2f67db5e4d6c958258c3d70fb2d0b1c8.asciidoc
@@ -3,7 +3,7 @@
response = client.indices.put_settings(
index: 'my-index-000001',
body: {
- "index.merge.policy.max_merge_at_once_explicit": nil
+ 'index.merge.policy.max_merge_at_once_explicit' => nil
}
)
puts response
diff --git a/docs/examples/guide/2fa45d74ba9933188c4728f8a9e5372c.asciidoc b/docs/examples/guide/2fa45d74ba9933188c4728f8a9e5372c.asciidoc
index 2ab87edf47..d45f7c2a0b 100644
--- a/docs/examples/guide/2fa45d74ba9933188c4728f8a9e5372c.asciidoc
+++ b/docs/examples/guide/2fa45d74ba9933188c4728f8a9e5372c.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "action.auto_create_index": 'my-index-000001,index10,-index1*,+ind*'
+ 'action.auto_create_index' => 'my-index-000001,index10,-index1*,+ind*'
}
}
)
@@ -12,7 +12,7 @@ puts response
response = client.cluster.put_settings(
body: {
persistent: {
- "action.auto_create_index": 'false'
+ 'action.auto_create_index' => 'false'
}
}
)
@@ -21,7 +21,7 @@ puts response
response = client.cluster.put_settings(
body: {
persistent: {
- "action.auto_create_index": 'true'
+ 'action.auto_create_index' => 'true'
}
}
)
diff --git a/docs/examples/guide/3182f26c61fbe5cf89400804533d5ed2.asciidoc b/docs/examples/guide/3182f26c61fbe5cf89400804533d5ed2.asciidoc
new file mode 100644
index 0000000000..d2440332ca
--- /dev/null
+++ b/docs/examples/guide/3182f26c61fbe5cf89400804533d5ed2.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.render_search_template(
+ body: {
+ id: 'my-search-template',
+ params: {
+ query_string: 'My string',
+ text_fields: [
+ {
+ user_name: 'John'
+ },
+ {
+ user_name: 'kimchy'
+ }
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/318e209cc4d6f306e65cb2f5598a50b1.asciidoc b/docs/examples/guide/318e209cc4d6f306e65cb2f5598a50b1.asciidoc
new file mode 100644
index 0000000000..5a85aab9fa
--- /dev/null
+++ b/docs/examples/guide/318e209cc4d6f306e65cb2f5598a50b1.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'LineString',
+ coordinates: [
+ [
+ -77.03653,
+ 38.897676
+ ],
+ [
+ -77.009051,
+ 38.889939
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/31a79a57b242713edec6795599ba0d5d.asciidoc b/docs/examples/guide/31a79a57b242713edec6795599ba0d5d.asciidoc
new file mode 100644
index 0000000000..1c42569f31
--- /dev/null
+++ b/docs/examples/guide/31a79a57b242713edec6795599ba0d5d.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index',
+ body: {
+ mappings: {
+ properties: {
+ my_tokens: {
+ type: 'sparse_vector'
+ },
+ my_text_field: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/32123981430e5a8b34fe14314fc48429.asciidoc b/docs/examples/guide/32123981430e5a8b34fe14314fc48429.asciidoc
index 358af7b653..c280bf0245 100644
--- a/docs/examples/guide/32123981430e5a8b34fe14314fc48429.asciidoc
+++ b/docs/examples/guide/32123981430e5a8b34fe14314fc48429.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/32a7acdfb7046966b28f394476c99126.asciidoc b/docs/examples/guide/32a7acdfb7046966b28f394476c99126.asciidoc
new file mode 100644
index 0000000000..a6c171f4ad
--- /dev/null
+++ b/docs/examples/guide/32a7acdfb7046966b28f394476c99126.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'POINT (-377.03653 389.897676)'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/32de5dd306bd014d67053d2f175defcd.asciidoc b/docs/examples/guide/32de5dd306bd014d67053d2f175defcd.asciidoc
index bdcfeff455..9639af9996 100644
--- a/docs/examples/guide/32de5dd306bd014d67053d2f175defcd.asciidoc
+++ b/docs/examples/guide/32de5dd306bd014d67053d2f175defcd.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "logger.org.elasticsearch.xpack.security.authc.saml": 'debug'
+ 'logger.org.elasticsearch.xpack.security.authc.saml' => 'debug'
}
}
)
diff --git a/docs/examples/guide/33732208fc6e6fe1e8d278299681932e.asciidoc b/docs/examples/guide/33732208fc6e6fe1e8d278299681932e.asciidoc
new file mode 100644
index 0000000000..47d77f24bc
--- /dev/null
+++ b/docs/examples/guide/33732208fc6e6fe1e8d278299681932e.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'LINESTRING (-377.03653 389.897676, -377.009051 389.889939)'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/3386fe07e90844dbcdbbe7c07f09e04a.asciidoc b/docs/examples/guide/3386fe07e90844dbcdbbe7c07f09e04a.asciidoc
new file mode 100644
index 0000000000..37570408e0
--- /dev/null
+++ b/docs/examples/guide/3386fe07e90844dbcdbbe7c07f09e04a.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.synonyms.delete_synonym(
+ id: 'my-synonyms-set'
+)
+puts response
+----
diff --git a/docs/examples/guide/33d480fc6812ada75756cf5337bc9092.asciidoc b/docs/examples/guide/33d480fc6812ada75756cf5337bc9092.asciidoc
new file mode 100644
index 0000000000..0c4a9213ef
--- /dev/null
+++ b/docs/examples/guide/33d480fc6812ada75756cf5337bc9092.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.connector.sync_job_list(
+ from: 0,
+ size: 2
+)
+puts response
+----
diff --git a/docs/examples/guide/342ddf9121aeddd82fea2464665e25da.asciidoc b/docs/examples/guide/342ddf9121aeddd82fea2464665e25da.asciidoc
new file mode 100644
index 0000000000..974b1eb6e5
--- /dev/null
+++ b/docs/examples/guide/342ddf9121aeddd82fea2464665e25da.asciidoc
@@ -0,0 +1,12 @@
+[source, ruby]
+----
+response = client.connector.put(
+ connector_id: 'my-connector',
+ body: {
+ index_name: 'search-google-drive',
+ name: 'My Connector',
+ service_type: 'google_drive'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/34c5cd33ba371fb79a793baf9f6e9fad.asciidoc b/docs/examples/guide/34c5cd33ba371fb79a793baf9f6e9fad.asciidoc
new file mode 100644
index 0000000000..b661b1af88
--- /dev/null
+++ b/docs/examples/guide/34c5cd33ba371fb79a793baf9f6e9fad.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ query: {
+ text_expansion: {
+ my_tokens: {
+ model_id: '.elser_model_2',
+ model_text: 'the query string'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc b/docs/examples/guide/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc
new file mode 100644
index 0000000000..fdf9888c07
--- /dev/null
+++ b/docs/examples/guide/34cdeefb09bbbe5206957a8bc1bd513d.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.indices.put_settings(
+ index: 'my-index-000001',
+ body: {
+ 'index.search.slowlog.include.user' => true
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/34d51c54b62e9a160c0ddacc10134bb0.asciidoc b/docs/examples/guide/34d51c54b62e9a160c0ddacc10134bb0.asciidoc
index 6377f0f014..235589b2ca 100644
--- a/docs/examples/guide/34d51c54b62e9a160c0ddacc10134bb0.asciidoc
+++ b/docs/examples/guide/34d51c54b62e9a160c0ddacc10134bb0.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
span_first: {
match: {
span_term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
end: 3
diff --git a/docs/examples/guide/34d63740b58209a3d031212909743925.asciidoc b/docs/examples/guide/34d63740b58209a3d031212909743925.asciidoc
new file mode 100644
index 0000000000..ae713fef54
--- /dev/null
+++ b/docs/examples/guide/34d63740b58209a3d031212909743925.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'openai-embeddings',
+ body: {
+ knn: {
+ field: 'content_embedding',
+ query_vector_builder: {
+ text_embedding: {
+ model_id: 'openai_embeddings',
+ model_text: 'Calculate fuel cost'
+ }
+ },
+ k: 10,
+ num_candidates: 100
+ },
+ _source: [
+ 'id',
+ 'content'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/357edc9d10e98ed776401c7a439a1a55.asciidoc b/docs/examples/guide/357edc9d10e98ed776401c7a439a1a55.asciidoc
new file mode 100644
index 0000000000..3b7da07c1a
--- /dev/null
+++ b/docs/examples/guide/357edc9d10e98ed776401c7a439a1a55.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.indices.resolve_cluster(
+ name: 'not-present,clust*:my-index*,oldcluster:*',
+ ignore_unavailable: false
+)
+puts response
+----
diff --git a/docs/examples/guide/35f892b475a1770f18328158be7039fd.asciidoc b/docs/examples/guide/35f892b475a1770f18328158be7039fd.asciidoc
new file mode 100644
index 0000000000..c4bdfd9750
--- /dev/null
+++ b/docs/examples/guide/35f892b475a1770f18328158be7039fd.asciidoc
@@ -0,0 +1,18 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index-2',
+ body: {
+ mappings: {
+ properties: {
+ my_vector: {
+ type: 'dense_vector',
+ dims: 3,
+ similarity: 'dot_product'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/360b3cef34bbddc5d9579ca95f0cb061.asciidoc b/docs/examples/guide/360b3cef34bbddc5d9579ca95f0cb061.asciidoc
new file mode 100644
index 0000000000..ea8c543dfd
--- /dev/null
+++ b/docs/examples/guide/360b3cef34bbddc5d9579ca95f0cb061.asciidoc
@@ -0,0 +1,15 @@
+[source, ruby]
+----
+response = client.indices.put_mapping(
+ index: 'my-data-stream',
+ write_index_only: true,
+ body: {
+ properties: {
+ message: {
+ type: 'text'
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/362dfccdb6f7933b22c909542e0b4e0a.asciidoc b/docs/examples/guide/362dfccdb6f7933b22c909542e0b4e0a.asciidoc
index 65ba88d31a..6fc6004a03 100644
--- a/docs/examples/guide/362dfccdb6f7933b22c909542e0b4e0a.asciidoc
+++ b/docs/examples/guide/362dfccdb6f7933b22c909542e0b4e0a.asciidoc
@@ -5,7 +5,7 @@ response = client.update_by_query(
body: {
query: {
match: {
- "user.id": 'l7gk7f82'
+ 'user.id' => 'l7gk7f82'
}
},
script: {
diff --git a/docs/examples/guide/365256ebdfa47b449780771d9beba8d9.asciidoc b/docs/examples/guide/365256ebdfa47b449780771d9beba8d9.asciidoc
new file mode 100644
index 0000000000..4953bdb2e7
--- /dev/null
+++ b/docs/examples/guide/365256ebdfa47b449780771d9beba8d9.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.sync_job_check_in(
+ connector_sync_job_id: 'my-connector-sync-job'
+)
+puts response
+----
diff --git a/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc b/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc
new file mode 100644
index 0000000000..0147fe261d
--- /dev/null
+++ b/docs/examples/guide/36b86b97feedcf5632824eefc251d6ed.asciidoc
@@ -0,0 +1,14 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'books',
+ body: {
+ query: {
+ match: {
+ name: 'brave'
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/370b297ed3433577adf53e64f572d89d.asciidoc b/docs/examples/guide/370b297ed3433577adf53e64f572d89d.asciidoc
new file mode 100644
index 0000000000..fdf6818555
--- /dev/null
+++ b/docs/examples/guide/370b297ed3433577adf53e64f572d89d.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.sync_job_delete(
+ connector_sync_job_id: 'my-connector-sync-job-id'
+)
+puts response
+----
diff --git a/docs/examples/guide/376ff4b2b5f657481af78a778aaab57f.asciidoc b/docs/examples/guide/376ff4b2b5f657481af78a778aaab57f.asciidoc
new file mode 100644
index 0000000000..ebb19baedf
--- /dev/null
+++ b/docs/examples/guide/376ff4b2b5f657481af78a778aaab57f.asciidoc
@@ -0,0 +1,75 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index',
+ body: {
+ mappings: {
+ properties: {
+ nr: {
+ type: 'integer'
+ },
+ state: {
+ type: 'keyword'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.bulk(
+ index: 'my-index',
+ refresh: true,
+ body: [
+ {
+ index: {}
+ },
+ {
+ nr: 1,
+ state: 'started'
+ },
+ {
+ index: {}
+ },
+ {
+ nr: 2,
+ state: 'stopped'
+ },
+ {
+ index: {}
+ },
+ {
+ nr: 3,
+ state: 'N/A'
+ },
+ {
+ index: {}
+ },
+ {
+ nr: 4
+ }
+ ]
+)
+puts response
+
+response = client.search(
+ index: 'my-index',
+ filter_path: 'aggregations',
+ body: {
+ aggregations: {
+ my_top_metrics: {
+ top_metrics: {
+ metrics: {
+ field: 'state',
+ missing: 'N/A'
+ },
+ sort: {
+ nr: 'desc'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/377af0ea9b19c113f224d8150890b41b.asciidoc b/docs/examples/guide/377af0ea9b19c113f224d8150890b41b.asciidoc
index 383aaf0032..cf052c9bc5 100644
--- a/docs/examples/guide/377af0ea9b19c113f224d8150890b41b.asciidoc
+++ b/docs/examples/guide/377af0ea9b19c113f224d8150890b41b.asciidoc
@@ -7,7 +7,7 @@ response = client.search(
filter: [
{
term: {
- "event.outcome": 'failure'
+ 'event.outcome' => 'failure'
}
},
{
@@ -20,7 +20,7 @@ response = client.search(
},
{
term: {
- "service.name": {
+ 'service.name' => {
value: 'frontend-node'
}
}
@@ -37,7 +37,7 @@ response = client.search(
must_not: [
{
term: {
- "event.outcome": 'failure'
+ 'event.outcome' => 'failure'
}
}
],
@@ -52,7 +52,7 @@ response = client.search(
},
{
term: {
- "service.name": {
+ 'service.name' => {
value: 'frontend-node'
}
}
diff --git a/docs/examples/guide/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc b/docs/examples/guide/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc
new file mode 100644
index 0000000000..3ac6f22168
--- /dev/null
+++ b/docs/examples/guide/388ec2b038d3ad69378f4c2e5bc36dce.asciidoc
@@ -0,0 +1,37 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ query: {
+ span_near: {
+ clauses: [
+ {
+ span_term: {
+ text: 'quick brown'
+ }
+ },
+ {
+ span_field_masking: {
+ query: {
+ span_term: {
+ 'text.stems' => 'fox'
+ }
+ },
+ field: 'text'
+ }
+ }
+ ],
+ slop: 5,
+ in_order: false
+ }
+ },
+ highlight: {
+ require_field_match: false,
+ fields: {
+ "*": {}
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/39ce44333d28ed2b833722d3e3cb06f3.asciidoc b/docs/examples/guide/39ce44333d28ed2b833722d3e3cb06f3.asciidoc
index 781a12134d..c176e1e0ea 100644
--- a/docs/examples/guide/39ce44333d28ed2b833722d3e3cb06f3.asciidoc
+++ b/docs/examples/guide/39ce44333d28ed2b833722d3e3cb06f3.asciidoc
@@ -8,7 +8,7 @@ response = client.search(
should: [
{
match: {
- "name.first": {
+ 'name.first' => {
query: 'shay',
_name: 'first'
}
@@ -16,7 +16,7 @@ response = client.search(
},
{
match: {
- "name.last": {
+ 'name.last' => {
query: 'banon',
_name: 'last'
}
@@ -25,7 +25,7 @@ response = client.search(
],
filter: {
terms: {
- "name.last": [
+ 'name.last' => [
'banon',
'kimchy'
],
diff --git a/docs/examples/guide/3a2953fd81d65118a776c87a81530e15.asciidoc b/docs/examples/guide/3a2953fd81d65118a776c87a81530e15.asciidoc
index 53a66bc9f3..9e22c4ef00 100644
--- a/docs/examples/guide/3a2953fd81d65118a776c87a81530e15.asciidoc
+++ b/docs/examples/guide/3a2953fd81d65118a776c87a81530e15.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
diff --git a/docs/examples/guide/3a3adae6dbb2c0316a7d98d0a6c1d4f8.asciidoc b/docs/examples/guide/3a3adae6dbb2c0316a7d98d0a6c1d4f8.asciidoc
new file mode 100644
index 0000000000..24486d9f05
--- /dev/null
+++ b/docs/examples/guide/3a3adae6dbb2c0316a7d98d0a6c1d4f8.asciidoc
@@ -0,0 +1,42 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'quantized-image-index',
+ body: {
+ knn: {
+ field: 'image-vector',
+ query_vector: [
+ 0.1,
+ -2
+ ],
+ k: 15,
+ num_candidates: 100
+ },
+ fields: [
+ 'title'
+ ],
+ rescore: {
+ window_size: 10,
+ query: {
+ rescore_query: {
+ script_score: {
+ query: {
+ match_all: {}
+ },
+ script: {
+ source: "cosineSimilarity(params.query_vector, 'image-vector') + 1.0",
+ params: {
+ query_vector: [
+ 0.1,
+ -2
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/3a64ae799cc03fadbb802794730c23da.asciidoc b/docs/examples/guide/3a64ae799cc03fadbb802794730c23da.asciidoc
new file mode 100644
index 0000000000..eeb701b7b9
--- /dev/null
+++ b/docs/examples/guide/3a64ae799cc03fadbb802794730c23da.asciidoc
@@ -0,0 +1,30 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'example_points',
+ body: {
+ mappings: {
+ properties: {
+ location: {
+ type: 'geo_point'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'example_points',
+ id: 1,
+ refresh: true,
+ body: {
+ name: 'Wind & Wetter, Berlin, Germany',
+ location: [
+ 13.400544,
+ 52.530286
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/3a7a6ab88a49b484fafb10c8eb09b562.asciidoc b/docs/examples/guide/3a7a6ab88a49b484fafb10c8eb09b562.asciidoc
new file mode 100644
index 0000000000..5d641117d6
--- /dev/null
+++ b/docs/examples/guide/3a7a6ab88a49b484fafb10c8eb09b562.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.ingest.put_pipeline(
+ id: 'cohere_embeddings',
+ body: {
+ processors: [
+ {
+ inference: {
+ model_id: 'cohere_embeddings',
+ input_output: {
+ input_field: 'content',
+ output_field: 'content_embedding'
+ }
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/3af10fde8138d9d95df127d39d9a0ed2.asciidoc b/docs/examples/guide/3af10fde8138d9d95df127d39d9a0ed2.asciidoc
index 220c95b658..d210a4ddb9 100644
--- a/docs/examples/guide/3af10fde8138d9d95df127d39d9a0ed2.asciidoc
+++ b/docs/examples/guide/3af10fde8138d9d95df127d39d9a0ed2.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.max_shards_per_node": nil
+ 'cluster.max_shards_per_node' => nil
}
}
)
diff --git a/docs/examples/guide/3afc6dacf90b42900ab571aad8a61d75.asciidoc b/docs/examples/guide/3afc6dacf90b42900ab571aad8a61d75.asciidoc
new file mode 100644
index 0000000000..6d5393c31c
--- /dev/null
+++ b/docs/examples/guide/3afc6dacf90b42900ab571aad8a61d75.asciidoc
@@ -0,0 +1,41 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'serbian_example',
+ body: {
+ settings: {
+ analysis: {
+ filter: {
+ serbian_stop: {
+ type: 'stop',
+ stopwords: '_serbian_'
+ },
+ serbian_keywords: {
+ type: 'keyword_marker',
+ keywords: [
+ 'пример'
+ ]
+ },
+ serbian_stemmer: {
+ type: 'stemmer',
+ language: 'serbian'
+ }
+ },
+ analyzer: {
+ rebuilt_serbian: {
+ tokenizer: 'standard',
+ filter: [
+ 'lowercase',
+ 'serbian_stop',
+ 'serbian_keywords',
+ 'serbian_stemmer',
+ 'serbian_normalization'
+ ]
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/3c09ca91057216125ed0e3856a91ff95.asciidoc b/docs/examples/guide/3c09ca91057216125ed0e3856a91ff95.asciidoc
index 0fed35d95d..fccfbc1f18 100644
--- a/docs/examples/guide/3c09ca91057216125ed0e3856a91ff95.asciidoc
+++ b/docs/examples/guide/3c09ca91057216125ed0e3856a91ff95.asciidoc
@@ -14,7 +14,7 @@ response = client.indices.put_index_template(
number_of_replicas: 0,
number_of_shards: 2
},
- "index.lifecycle.name": 'datastream_policy'
+ 'index.lifecycle.name' => 'datastream_policy'
},
mappings: {
properties: {
diff --git a/docs/examples/guide/3c65cb58e131ef46f4dd081683b970ac.asciidoc b/docs/examples/guide/3c65cb58e131ef46f4dd081683b970ac.asciidoc
index 492cae3168..5245ec03a8 100644
--- a/docs/examples/guide/3c65cb58e131ef46f4dd081683b970ac.asciidoc
+++ b/docs/examples/guide/3c65cb58e131ef46f4dd081683b970ac.asciidoc
@@ -11,7 +11,7 @@ response = client.search(
filter: {
geo_distance: {
distance: '200km',
- "pin.location": {
+ 'pin.location' => {
lat: 40,
lon: -70
}
diff --git a/docs/examples/guide/3c7621a81fa982b79f040a6d2611530e.asciidoc b/docs/examples/guide/3c7621a81fa982b79f040a6d2611530e.asciidoc
index 907746d154..957167898f 100644
--- a/docs/examples/guide/3c7621a81fa982b79f040a6d2611530e.asciidoc
+++ b/docs/examples/guide/3c7621a81fa982b79f040a6d2611530e.asciidoc
@@ -5,7 +5,7 @@ response = client.cluster.put_component_template(
body: {
template: {
settings: {
- "index.number_of_shards": 2
+ 'index.number_of_shards' => 2
}
}
}
@@ -17,7 +17,7 @@ response = client.cluster.put_component_template(
body: {
template: {
settings: {
- "index.number_of_replicas": 0
+ 'index.number_of_replicas' => 0
},
mappings: {
properties: {
diff --git a/docs/examples/guide/3d1ff6097e2359f927c88c2ccdb36252.asciidoc b/docs/examples/guide/3d1ff6097e2359f927c88c2ccdb36252.asciidoc
new file mode 100644
index 0000000000..e6a88d209d
--- /dev/null
+++ b/docs/examples/guide/3d1ff6097e2359f927c88c2ccdb36252.asciidoc
@@ -0,0 +1,5 @@
+[source, ruby]
+----
+response = client.info
+puts response
+----
diff --git a/docs/examples/guide/3da35090e093c2d83c3b7d0d83bcb4ae.asciidoc b/docs/examples/guide/3da35090e093c2d83c3b7d0d83bcb4ae.asciidoc
index 795cd59958..f0e63d9178 100644
--- a/docs/examples/guide/3da35090e093c2d83c3b7d0d83bcb4ae.asciidoc
+++ b/docs/examples/guide/3da35090e093c2d83c3b7d0d83bcb4ae.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.exclude._name": 'target-node-name'
+ 'cluster.routing.allocation.exclude._name' => 'target-node-name'
}
}
)
diff --git a/docs/examples/guide/3e278e6c193b4c17dbdc70670e15d78c.asciidoc b/docs/examples/guide/3e278e6c193b4c17dbdc70670e15d78c.asciidoc
index c34882e1b8..cf8694d9f2 100644
--- a/docs/examples/guide/3e278e6c193b4c17dbdc70670e15d78c.asciidoc
+++ b/docs/examples/guide/3e278e6c193b4c17dbdc70670e15d78c.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
diff --git a/docs/examples/guide/3e4227250d49e81df48773f8ba803ea7.asciidoc b/docs/examples/guide/3e4227250d49e81df48773f8ba803ea7.asciidoc
new file mode 100644
index 0000000000..b1a1e477b1
--- /dev/null
+++ b/docs/examples/guide/3e4227250d49e81df48773f8ba803ea7.asciidoc
@@ -0,0 +1,14 @@
+[source, ruby]
+----
+response = client.indices.put_mapping(
+ index: 'my-data-stream',
+ body: {
+ properties: {
+ message: {
+ type: 'text'
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/3e6db3d80439c2c176dbd1bb1296b6cf.asciidoc b/docs/examples/guide/3e6db3d80439c2c176dbd1bb1296b6cf.asciidoc
new file mode 100644
index 0000000000..f08535c752
--- /dev/null
+++ b/docs/examples/guide/3e6db3d80439c2c176dbd1bb1296b6cf.asciidoc
@@ -0,0 +1,12 @@
+[source, ruby]
+----
+response = client.render_search_template(
+ body: {
+ id: 'my-search-template',
+ params: {
+ query_string: 'hello world'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/3ed39eb60fbfafb70f7825b8d103bf17.asciidoc b/docs/examples/guide/3ed39eb60fbfafb70f7825b8d103bf17.asciidoc
index b7681145db..1676fd538e 100644
--- a/docs/examples/guide/3ed39eb60fbfafb70f7825b8d103bf17.asciidoc
+++ b/docs/examples/guide/3ed39eb60fbfafb70f7825b8d103bf17.asciidoc
@@ -11,7 +11,7 @@ response = client.search(
filter: {
geo_distance: {
distance: '200km',
- "pin.location": {
+ 'pin.location' => {
lat: 40,
lon: -70
}
diff --git a/docs/examples/guide/3f3b3e207f79303ce6f86e03e928e062.asciidoc b/docs/examples/guide/3f3b3e207f79303ce6f86e03e928e062.asciidoc
deleted file mode 100644
index 26796258c2..0000000000
--- a/docs/examples/guide/3f3b3e207f79303ce6f86e03e928e062.asciidoc
+++ /dev/null
@@ -1,8 +0,0 @@
-[source, ruby]
-----
-response = client.get(
- index: 'customer',
- id: 1
-)
-puts response
-----
diff --git a/docs/examples/guide/3fb2f41ad229a31ad3ae408cc50cbed5.asciidoc b/docs/examples/guide/3fb2f41ad229a31ad3ae408cc50cbed5.asciidoc
index b42cd912db..6e3527fee3 100644
--- a/docs/examples/guide/3fb2f41ad229a31ad3ae408cc50cbed5.asciidoc
+++ b/docs/examples/guide/3fb2f41ad229a31ad3ae408cc50cbed5.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
timeout: '2s',
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/4053de806dfd9172167999ce098107c4.asciidoc b/docs/examples/guide/4053de806dfd9172167999ce098107c4.asciidoc
index a62f9aa2f6..32fab044ee 100644
--- a/docs/examples/guide/4053de806dfd9172167999ce098107c4.asciidoc
+++ b/docs/examples/guide/4053de806dfd9172167999ce098107c4.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
constant_score: {
filter: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
boost: 1.2
diff --git a/docs/examples/guide/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc b/docs/examples/guide/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc
new file mode 100644
index 0000000000..a8873e82b4
--- /dev/null
+++ b/docs/examples/guide/405511f7c1f12cc0a227b4563fe7b2e2.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.esql.async_query_get(
+ id: 'FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM='
+)
+puts response
+----
diff --git a/docs/examples/guide/405ac843a9156d3cab374e199cac87fb.asciidoc b/docs/examples/guide/405ac843a9156d3cab374e199cac87fb.asciidoc
new file mode 100644
index 0000000000..14e1ae08cf
--- /dev/null
+++ b/docs/examples/guide/405ac843a9156d3cab374e199cac87fb.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.connector.sync_job_post(
+ body: {
+ id: 'connector-id',
+ job_type: 'full',
+ trigger_method: 'on_demand'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/41175d304e660da2931764f9a4418fd3.asciidoc b/docs/examples/guide/41175d304e660da2931764f9a4418fd3.asciidoc
new file mode 100644
index 0000000000..4ea20b6a83
--- /dev/null
+++ b/docs/examples/guide/41175d304e660da2931764f9a4418fd3.asciidoc
@@ -0,0 +1,15 @@
+[source, ruby]
+----
+response = client.connector.update_pipeline(
+ connector_id: 'my-connector',
+ body: {
+ pipeline: {
+ extract_binary_content: true,
+ name: 'my-connector-pipeline',
+ reduce_whitespace: true,
+ run_ml_inference: true
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/416a3ba11232d3c078c1c31340cf356f.asciidoc b/docs/examples/guide/416a3ba11232d3c078c1c31340cf356f.asciidoc
index cf39499999..3861cb273c 100644
--- a/docs/examples/guide/416a3ba11232d3c078c1c31340cf356f.asciidoc
+++ b/docs/examples/guide/416a3ba11232d3c078c1c31340cf356f.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
diff --git a/docs/examples/guide/4207219a892339e8f3abe0df8723dd27.asciidoc b/docs/examples/guide/4207219a892339e8f3abe0df8723dd27.asciidoc
index 94da51c2a4..0a4f6fda0e 100644
--- a/docs/examples/guide/4207219a892339e8f3abe0df8723dd27.asciidoc
+++ b/docs/examples/guide/4207219a892339e8f3abe0df8723dd27.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.metadata.administrator": 'sysadmin@example.com'
+ 'cluster.metadata.administrator' => 'sysadmin@example.com'
}
}
)
diff --git a/docs/examples/guide/42ba7c1d13aee91fe6f0a8a42c30eb74.asciidoc b/docs/examples/guide/42ba7c1d13aee91fe6f0a8a42c30eb74.asciidoc
new file mode 100644
index 0000000000..0fa4e9159d
--- /dev/null
+++ b/docs/examples/guide/42ba7c1d13aee91fe6f0a8a42c30eb74.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.indices.rollover(
+ alias: 'my-data-stream',
+ lazy: true
+)
+puts response
+----
diff --git a/docs/examples/guide/430705509f8367aef92be413f702520b.asciidoc b/docs/examples/guide/430705509f8367aef92be413f702520b.asciidoc
new file mode 100644
index 0000000000..50cefc667e
--- /dev/null
+++ b/docs/examples/guide/430705509f8367aef92be413f702520b.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.connector.update_status(
+ connector_id: 'my-connector',
+ body: {
+ status: 'needs_configuration'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/435e0d6a7d86e074d572d9671b7b9676.asciidoc b/docs/examples/guide/435e0d6a7d86e074d572d9671b7b9676.asciidoc
new file mode 100644
index 0000000000..7599f6105f
--- /dev/null
+++ b/docs/examples/guide/435e0d6a7d86e074d572d9671b7b9676.asciidoc
@@ -0,0 +1,36 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ 100,
+ 0
+ ],
+ [
+ 101,
+ 0
+ ],
+ [
+ 101,
+ 1
+ ],
+ [
+ 100,
+ 1
+ ],
+ [
+ 100,
+ 0
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/43854be6aae61edbea5f9ab988cb4ce5.asciidoc b/docs/examples/guide/43854be6aae61edbea5f9ab988cb4ce5.asciidoc
index 59f9be4c4a..d870920056 100644
--- a/docs/examples/guide/43854be6aae61edbea5f9ab988cb4ce5.asciidoc
+++ b/docs/examples/guide/43854be6aae61edbea5f9ab988cb4ce5.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "xpack.security.transport.filter.allow": '172.16.0.0/24'
+ 'xpack.security.transport.filter.allow' => '172.16.0.0/24'
}
}
)
diff --git a/docs/examples/guide/43e86fbaeed068dcc981214338559b5a.asciidoc b/docs/examples/guide/43e86fbaeed068dcc981214338559b5a.asciidoc
new file mode 100644
index 0000000000..ae3738c9fe
--- /dev/null
+++ b/docs/examples/guide/43e86fbaeed068dcc981214338559b5a.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.indices.resolve_cluster(
+ name: 'my-index-*,cluster*:my-index-*'
+)
+puts response
+----
diff --git a/docs/examples/guide/4435b654994b575ba181ea679871c78c.asciidoc b/docs/examples/guide/4435b654994b575ba181ea679871c78c.asciidoc
index 7a0544f0c0..b39662fadc 100644
--- a/docs/examples/guide/4435b654994b575ba181ea679871c78c.asciidoc
+++ b/docs/examples/guide/4435b654994b575ba181ea679871c78c.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/443e8da9968f1c65f46a2a65a1e1e078.asciidoc b/docs/examples/guide/443e8da9968f1c65f46a2a65a1e1e078.asciidoc
new file mode 100644
index 0000000000..8ef1002f6a
--- /dev/null
+++ b/docs/examples/guide/443e8da9968f1c65f46a2a65a1e1e078.asciidoc
@@ -0,0 +1,46 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'my-weather-sensor-index-template',
+ body: {
+ index_patterns: [
+ 'metrics-weather_sensors-*'
+ ],
+ data_stream: {},
+ template: {
+ settings: {
+ 'index.mode' => 'time_series',
+ 'index.lifecycle.name' => 'my-lifecycle-policy'
+ },
+ mappings: {
+ properties: {
+ sensor_id: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ location: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ temperature: {
+ type: 'half_float',
+ time_series_metric: 'gauge'
+ },
+ humidity: {
+ type: 'half_float',
+ time_series_metric: 'gauge'
+ },
+ "@timestamp": {
+ type: 'date'
+ }
+ }
+ }
+ },
+ priority: 500,
+ _meta: {
+ description: 'Template for my weather sensor data'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/443f0e8fbba83777b2df624879d188d5.asciidoc b/docs/examples/guide/443f0e8fbba83777b2df624879d188d5.asciidoc
new file mode 100644
index 0000000000..15426aec49
--- /dev/null
+++ b/docs/examples/guide/443f0e8fbba83777b2df624879d188d5.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.reindex(
+ wait_for_completion: false,
+ body: {
+ source: {
+ index: 'test-data',
+ size: 50
+ },
+ dest: {
+ index: 'azure-openai-embeddings',
+ pipeline: 'azure_openai_embeddings'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/445f8a6ef75fb43da52990b3a9063c78.asciidoc b/docs/examples/guide/445f8a6ef75fb43da52990b3a9063c78.asciidoc
index eae08a7cb1..1a881320d7 100644
--- a/docs/examples/guide/445f8a6ef75fb43da52990b3a9063c78.asciidoc
+++ b/docs/examples/guide/445f8a6ef75fb43da52990b3a9063c78.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "http.responses": '304'
+ 'http.responses' => '304'
}
},
fields: [
diff --git a/docs/examples/guide/4479e8c63a04fa22207a6a8803eadcad.asciidoc b/docs/examples/guide/4479e8c63a04fa22207a6a8803eadcad.asciidoc
new file mode 100644
index 0000000000..d6abceee23
--- /dev/null
+++ b/docs/examples/guide/4479e8c63a04fa22207a6a8803eadcad.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.cluster.put_settings(
+ body: {
+ persistent: {
+ 'cluster.routing.allocation.awareness.attributes' => 'rack_id'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/4498b9d3b0c77e1b9ef6664ff5963ce2.asciidoc b/docs/examples/guide/4498b9d3b0c77e1b9ef6664ff5963ce2.asciidoc
index fb9853e7b4..d28fe1e8ef 100644
--- a/docs/examples/guide/4498b9d3b0c77e1b9ef6664ff5963ce2.asciidoc
+++ b/docs/examples/guide/4498b9d3b0c77e1b9ef6664ff5963ce2.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.create(
index: 'my-index-000001',
body: {
settings: {
- "index.requests.cache.enable": false
+ 'index.requests.cache.enable' => false
}
}
)
diff --git a/docs/examples/guide/44da736ce0e1587c1e7c45eee606ead7.asciidoc b/docs/examples/guide/44da736ce0e1587c1e7c45eee606ead7.asciidoc
index 32c75fb132..275b20b224 100644
--- a/docs/examples/guide/44da736ce0e1587c1e7c45eee606ead7.asciidoc
+++ b/docs/examples/guide/44da736ce0e1587c1e7c45eee606ead7.asciidoc
@@ -9,7 +9,7 @@ response = client.update_by_query(
},
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/451b441c3311103d0d2bdbab771b26d2.asciidoc b/docs/examples/guide/451b441c3311103d0d2bdbab771b26d2.asciidoc
new file mode 100644
index 0000000000..b0001c15d6
--- /dev/null
+++ b/docs/examples/guide/451b441c3311103d0d2bdbab771b26d2.asciidoc
@@ -0,0 +1,13 @@
+[source, ruby]
+----
+response = client.put_script(
+ id: 'my-search-template',
+ body: {
+ script: {
+ lang: 'mustache',
+ source: "\n {\n \"query\": {\n \"match\": {\n {{=( )=}}\n \"message\": \"(query_string)\"\n (={{ }}=)\n }\n }\n }\n "
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/451e7c29b2cf738cfc822f7c175bef56.asciidoc b/docs/examples/guide/451e7c29b2cf738cfc822f7c175bef56.asciidoc
new file mode 100644
index 0000000000..36eb2823df
--- /dev/null
+++ b/docs/examples/guide/451e7c29b2cf738cfc822f7c175bef56.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'my-index-template',
+ body: {
+ index_patterns: [
+ 'my-data-stream*'
+ ],
+ data_stream: {},
+ priority: 500,
+ template: {
+ lifecycle: {
+ data_retention: '7d'
+ }
+ },
+ _meta: {
+ description: 'Template with data stream lifecycle'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/452a61fecda86dd5539451dd57ec73a9.asciidoc b/docs/examples/guide/452a61fecda86dd5539451dd57ec73a9.asciidoc
new file mode 100644
index 0000000000..764336f6de
--- /dev/null
+++ b/docs/examples/guide/452a61fecda86dd5539451dd57ec73a9.asciidoc
@@ -0,0 +1,36 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-image-index',
+ body: {
+ size: 3,
+ query: {
+ bool: {
+ should: [
+ {
+ match: {
+ title: {
+ query: 'mountain lake',
+ boost: 1
+ }
+ }
+ },
+ {
+ knn: {
+ field: 'image-vector',
+ query_vector: [
+ -5,
+ 9,
+ -12
+ ],
+ num_candidates: 10,
+ boost: 2
+ }
+ }
+ ]
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/455029c3d66306ad5d48f6dbddaf7324.asciidoc b/docs/examples/guide/455029c3d66306ad5d48f6dbddaf7324.asciidoc
index 8128f01e2b..e662f4c869 100644
--- a/docs/examples/guide/455029c3d66306ad5d48f6dbddaf7324.asciidoc
+++ b/docs/examples/guide/455029c3d66306ad5d48f6dbddaf7324.asciidoc
@@ -19,7 +19,7 @@ response = client.index(
id: 1,
refresh: true,
body: {
- "network.name": 'net-1',
+ 'network.name' => 'net-1',
latency_histo: {
values: [
0.1,
@@ -45,7 +45,7 @@ response = client.index(
id: 2,
refresh: true,
body: {
- "network.name": 'net-2',
+ 'network.name' => 'net-2',
latency_histo: {
values: [
0.1,
diff --git a/docs/examples/guide/45c6e54a9c9e08623af96752b4bde346.asciidoc b/docs/examples/guide/45c6e54a9c9e08623af96752b4bde346.asciidoc
index 5ebec85d11..7305b24a17 100644
--- a/docs/examples/guide/45c6e54a9c9e08623af96752b4bde346.asciidoc
+++ b/docs/examples/guide/45c6e54a9c9e08623af96752b4bde346.asciidoc
@@ -11,7 +11,7 @@ response = client.search(
filter: {
geo_distance: {
distance: '12km',
- "pin.location": 'POINT (-70 40)'
+ 'pin.location' => 'POINT (-70 40)'
}
}
}
diff --git a/docs/examples/guide/45ef5156dbd2d3fd4fd22b8d99f7aad4.asciidoc b/docs/examples/guide/45ef5156dbd2d3fd4fd22b8d99f7aad4.asciidoc
index f894cb224b..2296b26fd4 100644
--- a/docs/examples/guide/45ef5156dbd2d3fd4fd22b8d99f7aad4.asciidoc
+++ b/docs/examples/guide/45ef5156dbd2d3fd4fd22b8d99f7aad4.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.enable": nil
+ 'cluster.routing.allocation.enable' => nil
}
}
)
diff --git a/docs/examples/guide/46103fee3cd5f53dc75123def82d52ad.asciidoc b/docs/examples/guide/46103fee3cd5f53dc75123def82d52ad.asciidoc
new file mode 100644
index 0000000000..29176ceb6c
--- /dev/null
+++ b/docs/examples/guide/46103fee3cd5f53dc75123def82d52ad.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'my-data-stream-template',
+ body: {
+ index_patterns: [
+ 'my-data-stream*'
+ ],
+ data_stream: {},
+ priority: 500,
+ template: {
+ settings: {
+ 'index.refresh_interval' => '30s'
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/4670dd81a9865e07ae74ae8b0266e384.asciidoc b/docs/examples/guide/4670dd81a9865e07ae74ae8b0266e384.asciidoc
index 5491959e6c..002b08a594 100644
--- a/docs/examples/guide/4670dd81a9865e07ae74ae8b0266e384.asciidoc
+++ b/docs/examples/guide/4670dd81a9865e07ae74ae8b0266e384.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "startup_time_before.adjusted": {
+ 'startup_time_before.adjusted' => {
type: 'long',
script: {
source: "emit(doc['startup_time_before'].value - params.adjustment)",
diff --git a/docs/examples/guide/473c8ddd4e4b7814a64e5fe40d9d6dca.asciidoc b/docs/examples/guide/473c8ddd4e4b7814a64e5fe40d9d6dca.asciidoc
new file mode 100644
index 0000000000..2667da9ed5
--- /dev/null
+++ b/docs/examples/guide/473c8ddd4e4b7814a64e5fe40d9d6dca.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.tasks.cancel(
+ task_id: '2j8UKw1bRO283PMwDugNNg:5326'
+)
+puts response
+----
diff --git a/docs/examples/guide/4824a823a830a2a5d990eacfd783ac22.asciidoc b/docs/examples/guide/4824a823a830a2a5d990eacfd783ac22.asciidoc
index 411b6232c2..a4ee8c04c5 100644
--- a/docs/examples/guide/4824a823a830a2a5d990eacfd783ac22.asciidoc
+++ b/docs/examples/guide/4824a823a830a2a5d990eacfd783ac22.asciidoc
@@ -9,7 +9,7 @@ response = client.delete_by_query(
},
query: {
range: {
- "http.response.bytes": {
+ 'http.response.bytes' => {
lt: 2_000_000
}
}
@@ -27,7 +27,7 @@ response = client.delete_by_query(
},
query: {
range: {
- "http.response.bytes": {
+ 'http.response.bytes' => {
lt: 2_000_000
}
}
diff --git a/docs/examples/guide/484e24d1ed1a154ba9753e6090d38d78.asciidoc b/docs/examples/guide/484e24d1ed1a154ba9753e6090d38d78.asciidoc
new file mode 100644
index 0000000000..9732d8b09b
--- /dev/null
+++ b/docs/examples/guide/484e24d1ed1a154ba9753e6090d38d78.asciidoc
@@ -0,0 +1,16 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'point',
+ coordinates: [
+ -377.03653,
+ 389.897676
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/487f0e07fd83c05f9763e0795c525e2e.asciidoc b/docs/examples/guide/487f0e07fd83c05f9763e0795c525e2e.asciidoc
new file mode 100644
index 0000000000..c0b6f657f8
--- /dev/null
+++ b/docs/examples/guide/487f0e07fd83c05f9763e0795c525e2e.asciidoc
@@ -0,0 +1,100 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'test',
+ body: {
+ mappings: {
+ properties: {
+ my_location: {
+ type: 'geo_point'
+ },
+ group: {
+ type: 'keyword'
+ },
+ "@timestamp": {
+ type: 'date'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.bulk(
+ index: 'test',
+ refresh: true,
+ body: [
+ {
+ index: {}
+ },
+ {
+ my_location: {
+ lat: 52.373184,
+ lon: 4.889187
+ },
+ "@timestamp": '2023-01-02T09:00:00Z'
+ },
+ {
+ index: {}
+ },
+ {
+ my_location: {
+ lat: 52.370159,
+ lon: 4.885057
+ },
+ "@timestamp": '2023-01-02T10:00:00Z'
+ },
+ {
+ index: {}
+ },
+ {
+ my_location: {
+ lat: 52.369219,
+ lon: 4.901618
+ },
+ "@timestamp": '2023-01-02T13:00:00Z'
+ },
+ {
+ index: {}
+ },
+ {
+ my_location: {
+ lat: 52.374081,
+ lon: 4.91235
+ },
+ "@timestamp": '2023-01-02T16:00:00Z'
+ },
+ {
+ index: {}
+ },
+ {
+ my_location: {
+ lat: 52.371667,
+ lon: 4.914722
+ },
+ "@timestamp": '2023-01-03T12:00:00Z'
+ }
+ ]
+)
+puts response
+
+response = client.search(
+ index: 'test',
+ filter_path: 'aggregations',
+ body: {
+ aggregations: {
+ line: {
+ geo_line: {
+ point: {
+ field: 'my_location'
+ },
+ sort: {
+ field: '@timestamp'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/48d9697a14dfe131325521f48a7adc84.asciidoc b/docs/examples/guide/48d9697a14dfe131325521f48a7adc84.asciidoc
new file mode 100644
index 0000000000..a67670c51d
--- /dev/null
+++ b/docs/examples/guide/48d9697a14dfe131325521f48a7adc84.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.render_search_template(
+ body: {
+ id: 'my-search-template',
+ params: {
+ query_string: 'My string',
+ text_fields: [
+ {
+ user_name: 'John',
+ last: false
+ },
+ {
+ user_name: 'kimchy',
+ last: true
+ }
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/49c40b51da2469a6e00fea8fa6fbf56e.asciidoc b/docs/examples/guide/49c40b51da2469a6e00fea8fa6fbf56e.asciidoc
new file mode 100644
index 0000000000..f9af00a733
--- /dev/null
+++ b/docs/examples/guide/49c40b51da2469a6e00fea8fa6fbf56e.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.tasks.list(
+ pretty: true,
+ detailed: true,
+ group_by: 'parents',
+ human: true,
+ actions: '*data/read/esql'
+)
+puts response
+----
diff --git a/docs/examples/guide/4a7510a9c0468303658383c00796dad2.asciidoc b/docs/examples/guide/4a7510a9c0468303658383c00796dad2.asciidoc
index bca4de8242..e230d141be 100644
--- a/docs/examples/guide/4a7510a9c0468303658383c00796dad2.asciidoc
+++ b/docs/examples/guide/4a7510a9c0468303658383c00796dad2.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.create(
index: 'my-index-000001',
body: {
settings: {
- "index.mapping.ignore_malformed": true
+ 'index.mapping.ignore_malformed' => true
},
mappings: {
properties: {
diff --git a/docs/examples/guide/4aa510f34a0358fecc8d764dd099b843.asciidoc b/docs/examples/guide/4aa510f34a0358fecc8d764dd099b843.asciidoc
deleted file mode 100644
index 1c40f583bc..0000000000
--- a/docs/examples/guide/4aa510f34a0358fecc8d764dd099b843.asciidoc
+++ /dev/null
@@ -1,14 +0,0 @@
-[source, ruby]
-----
-response = client.indices.put_settings(
- index: 'my_source_index',
- body: {
- settings: {
- "index.number_of_replicas": 0,
- "index.routing.allocation.require._name": 'shrink_node_name',
- "index.blocks.write": true
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/4ae494d1e62231e832fc0436b04e2014.asciidoc b/docs/examples/guide/4ae494d1e62231e832fc0436b04e2014.asciidoc
index 376524b79a..ebb5e33834 100644
--- a/docs/examples/guide/4ae494d1e62231e832fc0436b04e2014.asciidoc
+++ b/docs/examples/guide/4ae494d1e62231e832fc0436b04e2014.asciidoc
@@ -12,7 +12,7 @@ response = client.indices.validate_query(
},
filter: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/4af15c4f26ddefb9c350e7a246a66a15.asciidoc b/docs/examples/guide/4af15c4f26ddefb9c350e7a246a66a15.asciidoc
index ab1a7d764a..93fe623517 100644
--- a/docs/examples/guide/4af15c4f26ddefb9c350e7a246a66a15.asciidoc
+++ b/docs/examples/guide/4af15c4f26ddefb9c350e7a246a66a15.asciidoc
@@ -9,7 +9,7 @@ response = client.search(
terms: {
field: 'ip',
order: {
- "tm.m": 'desc'
+ 'tm.m' => 'desc'
}
},
aggregations: {
diff --git a/docs/examples/guide/4b5110a21676cc0e26e050a4b4552235.asciidoc b/docs/examples/guide/4b5110a21676cc0e26e050a4b4552235.asciidoc
new file mode 100644
index 0000000000..2c4ab85194
--- /dev/null
+++ b/docs/examples/guide/4b5110a21676cc0e26e050a4b4552235.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.synonyms.get_synonym(
+ id: 'my-synonyms-set'
+)
+puts response
+----
diff --git a/docs/examples/guide/4bba59cf745ac7b996bf90308bc26957.asciidoc b/docs/examples/guide/4bba59cf745ac7b996bf90308bc26957.asciidoc
index 9e38458a93..96d1027978 100644
--- a/docs/examples/guide/4bba59cf745ac7b996bf90308bc26957.asciidoc
+++ b/docs/examples/guide/4bba59cf745ac7b996bf90308bc26957.asciidoc
@@ -12,7 +12,7 @@ response = client.search(
},
filter: {
term: {
- "file_path.tree": '/User/alice'
+ 'file_path.tree' => '/User/alice'
}
}
}
diff --git a/docs/examples/guide/4be20da16d2b58216e8b307218c7bf3a.asciidoc b/docs/examples/guide/4be20da16d2b58216e8b307218c7bf3a.asciidoc
new file mode 100644
index 0000000000..8410d14978
--- /dev/null
+++ b/docs/examples/guide/4be20da16d2b58216e8b307218c7bf3a.asciidoc
@@ -0,0 +1,28 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'my-data-stream-template',
+ body: {
+ index_patterns: [
+ 'my-data-stream*'
+ ],
+ data_stream: {},
+ priority: 500,
+ template: {
+ mappings: {
+ properties: {
+ host: {
+ properties: {
+ ip: {
+ type: 'ip',
+ ignore_malformed: true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/4bfcb2861f1d572bd0d66acd66deab0b.asciidoc b/docs/examples/guide/4bfcb2861f1d572bd0d66acd66deab0b.asciidoc
index 9bd102d9a6..7a13e0c476 100644
--- a/docs/examples/guide/4bfcb2861f1d572bd0d66acd66deab0b.asciidoc
+++ b/docs/examples/guide/4bfcb2861f1d572bd0d66acd66deab0b.asciidoc
@@ -5,7 +5,7 @@ response = client.ml.update_datafeed(
body: {
query: {
term: {
- "geo.src": 'US'
+ 'geo.src' => 'US'
}
}
}
diff --git a/docs/examples/guide/4cdcc3fde5cea165a3a7567962b9bd61.asciidoc b/docs/examples/guide/4cdcc3fde5cea165a3a7567962b9bd61.asciidoc
new file mode 100644
index 0000000000..9866a59676
--- /dev/null
+++ b/docs/examples/guide/4cdcc3fde5cea165a3a7567962b9bd61.asciidoc
@@ -0,0 +1,72 @@
+[source, ruby]
+----
+response = client.synonyms.put_synonym(
+ id: 'my-synonyms-set',
+ body: {
+ synonyms_set: [
+ {
+ id: 'test-1',
+ synonyms: 'hello, hi'
+ }
+ ]
+ }
+)
+puts response
+
+response = client.indices.create(
+ index: 'test-index',
+ body: {
+ settings: {
+ analysis: {
+ filter: {
+ synonyms_filter: {
+ type: 'synonym_graph',
+ synonyms_set: 'my-synonyms-set',
+ updateable: true
+ }
+ },
+ analyzer: {
+ my_index_analyzer: {
+ type: 'custom',
+ tokenizer: 'standard',
+ filter: [
+ 'lowercase'
+ ]
+ },
+ my_search_analyzer: {
+ type: 'custom',
+ tokenizer: 'standard',
+ filter: [
+ 'lowercase',
+ 'synonyms_filter'
+ ]
+ }
+ }
+ }
+ },
+ mappings: {
+ properties: {
+ title: {
+ type: 'text',
+ analyzer: 'my_index_analyzer',
+ search_analyzer: 'my_search_analyzer'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.synonyms.put_synonym(
+ id: 'my-synonyms-set',
+ body: {
+ synonyms_set: [
+ {
+ id: 'test-1',
+ synonyms: 'hello, hi, howdy'
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/4e3414fc712b16311f9e433dd366f49d.asciidoc b/docs/examples/guide/4e3414fc712b16311f9e433dd366f49d.asciidoc
new file mode 100644
index 0000000000..93ead6685d
--- /dev/null
+++ b/docs/examples/guide/4e3414fc712b16311f9e433dd366f49d.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.inference.delete_model(
+ task_type: 'sparse_embedding',
+ inference_id: 'my-elser-model'
+)
+puts response
+----
diff --git a/docs/examples/guide/4f621ab694f62ddb89e0684a9e76c4d1.asciidoc b/docs/examples/guide/4f621ab694f62ddb89e0684a9e76c4d1.asciidoc
index 9bc86e7a99..1db79c8d16 100644
--- a/docs/examples/guide/4f621ab694f62ddb89e0684a9e76c4d1.asciidoc
+++ b/docs/examples/guide/4f621ab694f62ddb89e0684a9e76c4d1.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
diff --git a/docs/examples/guide/4fcca1687d7b2cf08de526539fea5a76.asciidoc b/docs/examples/guide/4fcca1687d7b2cf08de526539fea5a76.asciidoc
new file mode 100644
index 0000000000..43ce1972c3
--- /dev/null
+++ b/docs/examples/guide/4fcca1687d7b2cf08de526539fea5a76.asciidoc
@@ -0,0 +1,43 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ query: {
+ bool: {
+ should: [
+ {
+ text_expansion: {
+ 'ml.inference.title_expanded.predicted_value' => {
+ model_id: '.elser_model_2',
+ model_text: 'How is the weather in Jamaica?',
+ boost: 1
+ }
+ }
+ },
+ {
+ text_expansion: {
+ 'ml.inference.description_expanded.predicted_value' => {
+ model_id: '.elser_model_2',
+ model_text: 'How is the weather in Jamaica?',
+ boost: 1
+ }
+ }
+ },
+ {
+ multi_match: {
+ query: 'How is the weather in Jamaica?',
+ fields: [
+ 'title',
+ 'description'
+ ],
+ boost: 4
+ }
+ }
+ ]
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/50522d3d5b3d055f712ad737e3d1707a.asciidoc b/docs/examples/guide/50522d3d5b3d055f712ad737e3d1707a.asciidoc
index d764ff26ac..be4556d408 100644
--- a/docs/examples/guide/50522d3d5b3d055f712ad737e3d1707a.asciidoc
+++ b/docs/examples/guide/50522d3d5b3d055f712ad737e3d1707a.asciidoc
@@ -43,7 +43,7 @@ response = client.search(
body: {
query: {
term: {
- "name.length": 3
+ 'name.length' => 3
}
}
}
diff --git a/docs/examples/guide/51390ca10aa22d7104e8970f09ea4512.asciidoc b/docs/examples/guide/51390ca10aa22d7104e8970f09ea4512.asciidoc
new file mode 100644
index 0000000000..ca759417ef
--- /dev/null
+++ b/docs/examples/guide/51390ca10aa22d7104e8970f09ea4512.asciidoc
@@ -0,0 +1,32 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'idx',
+ body: {
+ mappings: {
+ _source: {
+ mode: 'synthetic'
+ },
+ properties: {
+ binary: {
+ type: 'binary',
+ doc_values: true
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'idx',
+ id: 1,
+ body: {
+ binary: [
+ 'IAA=',
+ 'EAA='
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/515e1104d136082e826d1b32af011759.asciidoc b/docs/examples/guide/515e1104d136082e826d1b32af011759.asciidoc
new file mode 100644
index 0000000000..8315b4829b
--- /dev/null
+++ b/docs/examples/guide/515e1104d136082e826d1b32af011759.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'products',
+ id: 0,
+ refresh: true,
+ body: {
+ name: 'LED TV',
+ resellers: [
+ {
+ reseller: 'companyA',
+ price: 350
+ },
+ {
+ reseller: 'companyB',
+ price: 500
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/518fcf1dc1edd7dba0864accf71b49f4.asciidoc b/docs/examples/guide/518fcf1dc1edd7dba0864accf71b49f4.asciidoc
index c1eb983975..e6c12a28bf 100644
--- a/docs/examples/guide/518fcf1dc1edd7dba0864accf71b49f4.asciidoc
+++ b/docs/examples/guide/518fcf1dc1edd7dba0864accf71b49f4.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/51f6cb682424e110f289af79c106f4c7.asciidoc b/docs/examples/guide/51f6cb682424e110f289af79c106f4c7.asciidoc
index 55af6a0920..447372ca01 100644
--- a/docs/examples/guide/51f6cb682424e110f289af79c106f4c7.asciidoc
+++ b/docs/examples/guide/51f6cb682424e110f289af79c106f4c7.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.max_shards_per_node.frozen": 3200
+ 'cluster.max_shards_per_node.frozen' => 3200
}
}
)
diff --git a/docs/examples/guide/5276a831513623e43ed567eb52b6dba9.asciidoc b/docs/examples/guide/5276a831513623e43ed567eb52b6dba9.asciidoc
new file mode 100644
index 0000000000..a903a37bc9
--- /dev/null
+++ b/docs/examples/guide/5276a831513623e43ed567eb52b6dba9.asciidoc
@@ -0,0 +1,15 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'my-index-000001',
+ routing: 'my-routing-value',
+ body: {
+ "@timestamp": '2099-11-15T13:12:00',
+ message: 'GET /search HTTP/1.1 200 1070000',
+ user: {
+ id: 'kimchy'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/529b975b7cedaac58dce9821956adc37.asciidoc b/docs/examples/guide/529b975b7cedaac58dce9821956adc37.asciidoc
new file mode 100644
index 0000000000..5afbbc21d5
--- /dev/null
+++ b/docs/examples/guide/529b975b7cedaac58dce9821956adc37.asciidoc
@@ -0,0 +1,84 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'MultiPolygon',
+ coordinates: [
+ [
+ [
+ [
+ 102,
+ 2
+ ],
+ [
+ 103,
+ 2
+ ],
+ [
+ 103,
+ 3
+ ],
+ [
+ 102,
+ 3
+ ],
+ [
+ 102,
+ 2
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ 100,
+ 0
+ ],
+ [
+ 101,
+ 0
+ ],
+ [
+ 101,
+ 1
+ ],
+ [
+ 100,
+ 1
+ ],
+ [
+ 100,
+ 0
+ ]
+ ],
+ [
+ [
+ 100.2,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.2
+ ]
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/52a2d119addb15366a935115518335fd.asciidoc b/docs/examples/guide/52a2d119addb15366a935115518335fd.asciidoc
new file mode 100644
index 0000000000..26c940ad2d
--- /dev/null
+++ b/docs/examples/guide/52a2d119addb15366a935115518335fd.asciidoc
@@ -0,0 +1,13 @@
+[source, ruby]
+----
+response = client.indices.put_settings(
+ index: 'my_source_index',
+ body: {
+ settings: {
+ 'index.number_of_replicas' => 0,
+ 'index.routing.allocation.require._name' => 'shrink_node_name'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/52bc577a0d0cd42b46f33e0ef5124df8.asciidoc b/docs/examples/guide/52bc577a0d0cd42b46f33e0ef5124df8.asciidoc
new file mode 100644
index 0000000000..ca06e55db9
--- /dev/null
+++ b/docs/examples/guide/52bc577a0d0cd42b46f33e0ef5124df8.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.put_script(
+ id: 'my-search-template',
+ body: {
+ script: {
+ lang: 'mustache',
+ source: {
+ query: {
+ match: {
+ message: '{{query_string}}'
+ }
+ },
+ from: '{{from}}',
+ size: '{{size}}'
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/52be795b68e6ef3f396f35fea52d0481.asciidoc b/docs/examples/guide/52be795b68e6ef3f396f35fea52d0481.asciidoc
new file mode 100644
index 0000000000..3c215c3b6e
--- /dev/null
+++ b/docs/examples/guide/52be795b68e6ef3f396f35fea52d0481.asciidoc
@@ -0,0 +1,14 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'my-data-stream-template',
+ body: {
+ index_patterns: [
+ 'my-data-stream*'
+ ],
+ data_stream: {},
+ priority: 500
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/53aa8b21e2b1c4d48960343711296704.asciidoc b/docs/examples/guide/53aa8b21e2b1c4d48960343711296704.asciidoc
index 4b7b3ae5dd..553658d9ff 100644
--- a/docs/examples/guide/53aa8b21e2b1c4d48960343711296704.asciidoc
+++ b/docs/examples/guide/53aa8b21e2b1c4d48960343711296704.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
regexp: {
- "my_field.keyword": 'a\\\\.*'
+ 'my_field.keyword' => 'a\\\\.*'
}
}
}
diff --git a/docs/examples/guide/53bb7f0e3429861aadb8dd3d588085cd.asciidoc b/docs/examples/guide/53bb7f0e3429861aadb8dd3d588085cd.asciidoc
index 582810af28..f7ac8c0224 100644
--- a/docs/examples/guide/53bb7f0e3429861aadb8dd3d588085cd.asciidoc
+++ b/docs/examples/guide/53bb7f0e3429861aadb8dd3d588085cd.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
seq_no_primary_term: true,
query: {
match: {
- "user.id": 'yWIumJd7'
+ 'user.id' => 'yWIumJd7'
}
}
}
diff --git a/docs/examples/guide/53c6256295111524d5ff2885bdcb99a9.asciidoc b/docs/examples/guide/53c6256295111524d5ff2885bdcb99a9.asciidoc
index 7dd23fda14..9023a1e760 100644
--- a/docs/examples/guide/53c6256295111524d5ff2885bdcb99a9.asciidoc
+++ b/docs/examples/guide/53c6256295111524d5ff2885bdcb99a9.asciidoc
@@ -1,7 +1,7 @@
[source, ruby]
----
-response = client.indices.get(
- index: '_transform',
+response = client.transform.get_transform(
+ transform_id: '_stats',
from: 5,
size: 10
)
diff --git a/docs/examples/guide/543c3a77880adf281099df1a41f6b96a.asciidoc b/docs/examples/guide/543c3a77880adf281099df1a41f6b96a.asciidoc
new file mode 100644
index 0000000000..d38d8a9c06
--- /dev/null
+++ b/docs/examples/guide/543c3a77880adf281099df1a41f6b96a.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.esql.query(
+ body: {
+ locale: 'fr-FR',
+ query: "\n ROW birth_date_string = \"2023-01-15T00:00:00.000Z\"\n | EVAL birth_date = date_parse(birth_date_string)\n | EVAL month_of_birth = DATE_FORMAT(\"MMMM\",birth_date)\n | LIMIT 5\n ",
+ version: '2024.04.01'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/548b85bd9e6e7d33e36133953869449b.asciidoc b/docs/examples/guide/548b85bd9e6e7d33e36133953869449b.asciidoc
index ed37c12a9d..72e7f48701 100644
--- a/docs/examples/guide/548b85bd9e6e7d33e36133953869449b.asciidoc
+++ b/docs/examples/guide/548b85bd9e6e7d33e36133953869449b.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "xpack.monitoring.collection.enabled": false
+ 'xpack.monitoring.collection.enabled' => false
}
}
)
diff --git a/docs/examples/guide/55096381f811388fafd8e244dd2402c8.asciidoc b/docs/examples/guide/55096381f811388fafd8e244dd2402c8.asciidoc
index f149619242..24cdefa4b9 100644
--- a/docs/examples/guide/55096381f811388fafd8e244dd2402c8.asciidoc
+++ b/docs/examples/guide/55096381f811388fafd8e244dd2402c8.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.rollover(
alias: 'my-alias',
body: {
settings: {
- "index.number_of_shards": 2
+ 'index.number_of_shards' => 2
}
}
)
diff --git a/docs/examples/guide/5553cf7a02c22f616cd994747f2dd5a5.asciidoc b/docs/examples/guide/5553cf7a02c22f616cd994747f2dd5a5.asciidoc
index c1da504695..33b7049e45 100644
--- a/docs/examples/guide/5553cf7a02c22f616cd994747f2dd5a5.asciidoc
+++ b/docs/examples/guide/5553cf7a02c22f616cd994747f2dd5a5.asciidoc
@@ -8,12 +8,12 @@ response = client.search(
must: [
{
match: {
- "user.first": 'Alice'
+ 'user.first' => 'Alice'
}
},
{
match: {
- "user.last": 'Smith'
+ 'user.last' => 'Smith'
}
}
]
diff --git a/docs/examples/guide/55838e0b21c4f4da2dc8aaec045a6d5f.asciidoc b/docs/examples/guide/55838e0b21c4f4da2dc8aaec045a6d5f.asciidoc
index 90db32e316..207a8224ef 100644
--- a/docs/examples/guide/55838e0b21c4f4da2dc8aaec045a6d5f.asciidoc
+++ b/docs/examples/guide/55838e0b21c4f4da2dc8aaec045a6d5f.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "load_time.seconds": {
+ 'load_time.seconds' => {
type: 'long',
script: {
source: "emit(doc['load_time'].value / params.timeUnit)",
diff --git a/docs/examples/guide/565908b03edff1d6e6e7cdfb92177faf.asciidoc b/docs/examples/guide/565908b03edff1d6e6e7cdfb92177faf.asciidoc
index 1695e59451..8ec58ed61f 100644
--- a/docs/examples/guide/565908b03edff1d6e6e7cdfb92177faf.asciidoc
+++ b/docs/examples/guide/565908b03edff1d6e6e7cdfb92177faf.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "grade.weighted": {
+ 'grade.weighted' => {
type: 'double',
script: "\n emit(doc['grade'].value * doc['weight'].value)\n "
}
diff --git a/docs/examples/guide/571314a948e49f1f9614d36fcf79392a.asciidoc b/docs/examples/guide/571314a948e49f1f9614d36fcf79392a.asciidoc
new file mode 100644
index 0000000000..bf14021769
--- /dev/null
+++ b/docs/examples/guide/571314a948e49f1f9614d36fcf79392a.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.async_search.get(
+ id: 'FjktRGJ1Y2w1U0phLTRhZnVyeUZ2MVEbWEJyeVBPQldTV3FGZGdIeUVabXBldzo5NzA4'
+)
+puts response
+----
diff --git a/docs/examples/guide/578808065fee8691355b8f25c35782cd.asciidoc b/docs/examples/guide/578808065fee8691355b8f25c35782cd.asciidoc
index b309f98009..e21912fc6c 100644
--- a/docs/examples/guide/578808065fee8691355b8f25c35782cd.asciidoc
+++ b/docs/examples/guide/578808065fee8691355b8f25c35782cd.asciidoc
@@ -7,7 +7,7 @@ response = client.search(
profile: true,
query: {
term: {
- "user.id": {
+ 'user.id' => {
value: 'elkbee'
}
}
diff --git a/docs/examples/guide/5865ca8d2bcd087ed5dbee33fafee57f.asciidoc b/docs/examples/guide/5865ca8d2bcd087ed5dbee33fafee57f.asciidoc
new file mode 100644
index 0000000000..ba4759cad5
--- /dev/null
+++ b/docs/examples/guide/5865ca8d2bcd087ed5dbee33fafee57f.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.indices.explain_data_lifecycle(
+ index: '.ds-my-data-stream-*'
+)
+puts response
+----
diff --git a/docs/examples/guide/58f72be60c25752d7899a35fc60fe6eb.asciidoc b/docs/examples/guide/58f72be60c25752d7899a35fc60fe6eb.asciidoc
index 139a5b7834..51ecd22796 100644
--- a/docs/examples/guide/58f72be60c25752d7899a35fc60fe6eb.asciidoc
+++ b/docs/examples/guide/58f72be60c25752d7899a35fc60fe6eb.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "logger.org.elasticsearch.indices.recovery": 'DEBUG'
+ 'logger.org.elasticsearch.indices.recovery' => 'DEBUG'
}
}
)
diff --git a/docs/examples/guide/591bf50bb5ad3134006efe5c3f46d7a6.asciidoc b/docs/examples/guide/591bf50bb5ad3134006efe5c3f46d7a6.asciidoc
deleted file mode 100644
index 8c5d54139a..0000000000
--- a/docs/examples/guide/591bf50bb5ad3134006efe5c3f46d7a6.asciidoc
+++ /dev/null
@@ -1,31 +0,0 @@
-[source, ruby]
-----
-response = client.cluster.put_settings(
- body: {
- persistent: {
- cluster: {
- remote: {
- cluster_one: {
- seeds: [
- '127.0.0.1:9300'
- ]
- },
- cluster_two: {
- mode: 'sniff',
- seeds: [
- '127.0.0.1:9301'
- ],
- "transport.compress": true,
- skip_unavailable: true
- },
- cluster_three: {
- mode: 'proxy',
- proxy_address: '127.0.0.1:9302'
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/5969c446688c8b326acc80276573e9d2.asciidoc b/docs/examples/guide/5969c446688c8b326acc80276573e9d2.asciidoc
index 86384c4346..d67f8fc3d7 100644
--- a/docs/examples/guide/5969c446688c8b326acc80276573e9d2.asciidoc
+++ b/docs/examples/guide/5969c446688c8b326acc80276573e9d2.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
@@ -19,13 +19,13 @@ response = client.search(
''
]
},
- "blog.title": {
+ 'blog.title' => {
number_of_fragments: 0
},
- "blog.author": {
+ 'blog.author' => {
number_of_fragments: 0
},
- "blog.comment": {
+ 'blog.comment' => {
number_of_fragments: 5,
order: 'score'
}
diff --git a/docs/examples/guide/5a006feed86309b547bbaa1baca1c496.asciidoc b/docs/examples/guide/5a006feed86309b547bbaa1baca1c496.asciidoc
new file mode 100644
index 0000000000..d502847953
--- /dev/null
+++ b/docs/examples/guide/5a006feed86309b547bbaa1baca1c496.asciidoc
@@ -0,0 +1,71 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index-000001',
+ body: {
+ mappings: {
+ dynamic_templates: [
+ {
+ numeric_counts: {
+ match_mapping_type: [
+ 'long',
+ 'double'
+ ],
+ match: 'count',
+ mapping: {
+ type: '{dynamic_type}',
+ index: false
+ }
+ }
+ },
+ {
+ integers: {
+ match_mapping_type: 'long',
+ mapping: {
+ type: 'integer'
+ }
+ }
+ },
+ {
+ strings: {
+ match_mapping_type: 'string',
+ mapping: {
+ type: 'text',
+ fields: {
+ raw: {
+ type: 'keyword',
+ ignore_above: 256
+ }
+ }
+ }
+ }
+ },
+ {
+ non_objects_keyword: {
+ match_mapping_type: '*',
+ unmatch_mapping_type: 'object',
+ mapping: {
+ type: 'keyword'
+ }
+ }
+ }
+ ]
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'my-index-000001',
+ id: 1,
+ body: {
+ my_integer: 5,
+ my_string: 'Some string',
+ my_boolean: 'false',
+ field: {
+ count: 4
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/5a7f05ab1d05b4eef5ff327168517165.asciidoc b/docs/examples/guide/5a7f05ab1d05b4eef5ff327168517165.asciidoc
index 331127e9da..9f8c918a2c 100644
--- a/docs/examples/guide/5a7f05ab1d05b4eef5ff327168517165.asciidoc
+++ b/docs/examples/guide/5a7f05ab1d05b4eef5ff327168517165.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/5c7ece1f30267adabdb832424871900a.asciidoc b/docs/examples/guide/5c7ece1f30267adabdb832424871900a.asciidoc
new file mode 100644
index 0000000000..ae6b0b230b
--- /dev/null
+++ b/docs/examples/guide/5c7ece1f30267adabdb832424871900a.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.cat.allocation(
+ v: true
+)
+puts response
+----
diff --git a/docs/examples/guide/5cbfc259df140862818c10eb8a96ba97.asciidoc b/docs/examples/guide/5cbfc259df140862818c10eb8a96ba97.asciidoc
deleted file mode 100644
index 6cfb0c7f87..0000000000
--- a/docs/examples/guide/5cbfc259df140862818c10eb8a96ba97.asciidoc
+++ /dev/null
@@ -1,84 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'test',
- body: {
- mappings: {
- dynamic: 'strict',
- _source: {
- enabled: false
- },
- properties: {
- my_location: {
- type: 'geo_point'
- },
- group: {
- type: 'keyword'
- },
- "@timestamp": {
- type: 'date'
- }
- }
- }
- }
-)
-puts response
-
-response = client.bulk(
- index: 'test',
- refresh: true,
- body: [
- {
- index: {}
- },
- {
- my_location: {
- lat: 37.345057,
- lon: -122.049982
- },
- "@timestamp": '2013-09-06T16:00:36'
- },
- {
- index: {}
- },
- {
- my_location: {
- lat: 37.345132,
- lon: -122.049982
- },
- "@timestamp": '2013-09-06T16:00:37Z'
- },
- {
- index: {}
- },
- {
- my_location: {
- lat: 37.349283,
- lon: -122.050501
- },
- "@timestamp": '2013-09-06T16:00:37Z'
- }
- ]
-)
-puts response
-
-response = client.search(
- index: 'test',
- filter_path: 'aggregations',
- body: {
- aggregations: {
- line: {
- geo_line: {
- point: {
- field: 'my_location'
- },
- sort: {
- field: '@timestamp'
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/5db5349162a4fbe74bffb646926a2495.asciidoc b/docs/examples/guide/5db5349162a4fbe74bffb646926a2495.asciidoc
new file mode 100644
index 0000000000..7a7e45ae07
--- /dev/null
+++ b/docs/examples/guide/5db5349162a4fbe74bffb646926a2495.asciidoc
@@ -0,0 +1,31 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'idx',
+ body: {
+ mappings: {
+ _source: {
+ mode: 'synthetic'
+ },
+ properties: {
+ my_range: {
+ type: 'long_range'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'idx',
+ id: 1,
+ body: {
+ my_range: {
+ gt: 200,
+ lt: 300
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/5e2f7097eb299de553d0fa0087d70a59.asciidoc b/docs/examples/guide/5e2f7097eb299de553d0fa0087d70a59.asciidoc
index 0f08126e84..becbee211e 100644
--- a/docs/examples/guide/5e2f7097eb299de553d0fa0087d70a59.asciidoc
+++ b/docs/examples/guide/5e2f7097eb299de553d0fa0087d70a59.asciidoc
@@ -5,11 +5,11 @@ response = client.indices.create(
body: {
settings: {
index: {
- "sort.field": [
+ 'sort.field' => [
'username',
'timestamp'
],
- "sort.order": [
+ 'sort.order' => [
'asc',
'desc'
]
diff --git a/docs/examples/guide/5e415c490a46358643ee2aab554b4876.asciidoc b/docs/examples/guide/5e415c490a46358643ee2aab554b4876.asciidoc
new file mode 100644
index 0000000000..4b992d5fe4
--- /dev/null
+++ b/docs/examples/guide/5e415c490a46358643ee2aab554b4876.asciidoc
@@ -0,0 +1,12 @@
+[source, ruby]
+----
+response = client.cluster.allocation_explain(
+ filter_path: 'index,node_allocation_decisions.node_name,node_allocation_decisions.deciders.*',
+ body: {
+ index: 'my-index',
+ shard: 0,
+ primary: false
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/5e9a7845e60b79685aab59877c5fbd1a.asciidoc b/docs/examples/guide/5e9a7845e60b79685aab59877c5fbd1a.asciidoc
new file mode 100644
index 0000000000..227b9ffa09
--- /dev/null
+++ b/docs/examples/guide/5e9a7845e60b79685aab59877c5fbd1a.asciidoc
@@ -0,0 +1,15 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ aggregations: {
+ ignored_fields: {
+ terms: {
+ field: '_ignored'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/62e073b6b8ef533b5f3551bad623c070.asciidoc b/docs/examples/guide/62e073b6b8ef533b5f3551bad623c070.asciidoc
deleted file mode 100644
index 7aba03f82b..0000000000
--- a/docs/examples/guide/62e073b6b8ef533b5f3551bad623c070.asciidoc
+++ /dev/null
@@ -1,45 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'my-index-000001',
- body: {
- mappings: {
- dynamic_templates: [
- {
- integers: {
- match_mapping_type: 'long',
- mapping: {
- type: 'integer'
- }
- }
- },
- {
- strings: {
- match_mapping_type: 'string',
- mapping: {
- type: 'text',
- fields: {
- raw: {
- type: 'keyword',
- ignore_above: 256
- }
- }
- }
- }
- }
- ]
- }
- }
-)
-puts response
-
-response = client.index(
- index: 'my-index-000001',
- id: 1,
- body: {
- my_integer: 5,
- my_string: 'Some string'
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/6352e846bb83725ae6d853aa64d8697d.asciidoc b/docs/examples/guide/6352e846bb83725ae6d853aa64d8697d.asciidoc
index ce4386f972..faf528cbcc 100644
--- a/docs/examples/guide/6352e846bb83725ae6d853aa64d8697d.asciidoc
+++ b/docs/examples/guide/6352e846bb83725ae6d853aa64d8697d.asciidoc
@@ -11,7 +11,7 @@ response = client.search(
filter: {
geo_distance: {
distance: '12km',
- "pin.location": {
+ 'pin.location' => {
lat: 40,
lon: -70
}
diff --git a/docs/examples/guide/640621cea39cdeeb76fbc95bff31a18d.asciidoc b/docs/examples/guide/640621cea39cdeeb76fbc95bff31a18d.asciidoc
new file mode 100644
index 0000000000..c3710d0691
--- /dev/null
+++ b/docs/examples/guide/640621cea39cdeeb76fbc95bff31a18d.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.connector.last_sync(
+ connector_id: 'my-connector',
+ body: {
+ last_access_control_sync_error: 'Houston, we have a problem!',
+ last_access_control_sync_scheduled_at: '2023-11-09T15:13:08.231Z',
+ last_access_control_sync_status: 'pending',
+ last_deleted_document_count: 42,
+ last_incremental_sync_scheduled_at: '2023-11-09T15:13:08.231Z',
+ last_indexed_document_count: 42,
+ last_sync_error: 'Houston, we have a problem!',
+ last_sync_scheduled_at: '2024-11-09T15:13:08.231Z',
+ last_sync_status: 'completed',
+ last_synced: '2024-11-09T15:13:08.231Z'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/640da6dd719a34975b5627dfa5fcdd55.asciidoc b/docs/examples/guide/640da6dd719a34975b5627dfa5fcdd55.asciidoc
index 87610fa161..ceb997d653 100644
--- a/docs/examples/guide/640da6dd719a34975b5627dfa5fcdd55.asciidoc
+++ b/docs/examples/guide/640da6dd719a34975b5627dfa5fcdd55.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "xpack.monitoring.collection.enabled": true
+ 'xpack.monitoring.collection.enabled' => true
}
}
)
diff --git a/docs/examples/guide/640e4f2c2d29f9851320a70927bd7a6c.asciidoc b/docs/examples/guide/640e4f2c2d29f9851320a70927bd7a6c.asciidoc
index 59e12dc8bc..ade82466df 100644
--- a/docs/examples/guide/640e4f2c2d29f9851320a70927bd7a6c.asciidoc
+++ b/docs/examples/guide/640e4f2c2d29f9851320a70927bd7a6c.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "indices.lifecycle.poll_interval": nil
+ 'indices.lifecycle.poll_interval' => nil
}
}
)
diff --git a/docs/examples/guide/645433e8e479e5d71c100f66dd2de5d0.asciidoc b/docs/examples/guide/645433e8e479e5d71c100f66dd2de5d0.asciidoc
new file mode 100644
index 0000000000..611047ac1d
--- /dev/null
+++ b/docs/examples/guide/645433e8e479e5d71c100f66dd2de5d0.asciidoc
@@ -0,0 +1,531 @@
+[source, ruby]
+----
+response = client.bulk(
+ index: 'my-data-stream',
+ refresh: true,
+ pipeline: 'my-timestamp-pipeline',
+ body: [
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:49:00Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 91_153,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 463_314_616
+ },
+ usage: {
+ bytes: 307_007_078,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 585_236
+ },
+ rss: {
+ bytes: 102_728
+ },
+ pagefaults: 120_901,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:45:50Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 124_501,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 982_546_514
+ },
+ usage: {
+ bytes: 360_035_574,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 1_339_884
+ },
+ rss: {
+ bytes: 381_174
+ },
+ pagefaults: 178_473,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:44:50Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 38_907,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 862_723_768
+ },
+ usage: {
+ bytes: 379_572_388,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 431_227
+ },
+ rss: {
+ bytes: 386_580
+ },
+ pagefaults: 233_166,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:44:40Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 86_706,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 567_160_996
+ },
+ usage: {
+ bytes: 103_266_017,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 1_724_908
+ },
+ rss: {
+ bytes: 105_431
+ },
+ pagefaults: 233_166,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:44:00Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 150_069,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 639_054_643
+ },
+ usage: {
+ bytes: 265_142_477,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 1_786_511
+ },
+ rss: {
+ bytes: 189_235
+ },
+ pagefaults: 138_172,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:42:40Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 82_260,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 854_735_585
+ },
+ usage: {
+ bytes: 309_798_052,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 924_058
+ },
+ rss: {
+ bytes: 110_838
+ },
+ pagefaults: 259_073,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:42:10Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 153_404,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 279_586_406
+ },
+ usage: {
+ bytes: 214_904_955,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 1_047_265
+ },
+ rss: {
+ bytes: 91_914
+ },
+ pagefaults: 302_252,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:40:20Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 125_613,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 822_782_853
+ },
+ usage: {
+ bytes: 100_475_044,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 2_109_932
+ },
+ rss: {
+ bytes: 278_446
+ },
+ pagefaults: 74_843,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:40:10Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 100_046,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 567_160_996
+ },
+ usage: {
+ bytes: 362_826_547,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 1_986_724
+ },
+ rss: {
+ bytes: 402_801
+ },
+ pagefaults: 296_495,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2022-06-21T15:38:30Z',
+ kubernetes: {
+ host: 'gke-apps-0',
+ node: 'gke-apps-0-0',
+ pod: 'gke-apps-0-0-0',
+ container: {
+ cpu: {
+ usage: {
+ nanocores: 40_018,
+ core: {
+ ns: 12_828_317_850
+ },
+ node: {
+ pct: 2.77905e-05
+ },
+ limit: {
+ pct: 2.77905e-05
+ }
+ }
+ },
+ memory: {
+ available: {
+ bytes: 1_062_428_344
+ },
+ usage: {
+ bytes: 265_142_477,
+ node: {
+ pct: 0.01770037710617187
+ },
+ limit: {
+ pct: 9.923134671484496e-05
+ }
+ },
+ workingset: {
+ bytes: 2_294_743
+ },
+ rss: {
+ bytes: 340_623
+ },
+ pagefaults: 224_530,
+ majorpagefaults: 0
+ },
+ start_time: '2021-03-30T07:59:06Z',
+ name: 'container-name-44'
+ },
+ namespace: 'namespace26'
+ }
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/64622409407316d2d47094e692d9b516.asciidoc b/docs/examples/guide/64622409407316d2d47094e692d9b516.asciidoc
index 7a2a276282..f258e13d73 100644
--- a/docs/examples/guide/64622409407316d2d47094e692d9b516.asciidoc
+++ b/docs/examples/guide/64622409407316d2d47094e692d9b516.asciidoc
@@ -5,7 +5,7 @@ response = client.ml.evaluate_data_frame(
index: 'student_performance_mathematics_reg',
query: {
term: {
- "ml.is_training": {
+ 'ml.is_training' => {
value: false
}
}
diff --git a/docs/examples/guide/64b9baa6d7556b960b29698f3383aa31.asciidoc b/docs/examples/guide/64b9baa6d7556b960b29698f3383aa31.asciidoc
deleted file mode 100644
index d17c9ffd6f..0000000000
--- a/docs/examples/guide/64b9baa6d7556b960b29698f3383aa31.asciidoc
+++ /dev/null
@@ -1,23 +0,0 @@
-[source, ruby]
-----
-response = client.reindex(
- body: {
- source: {
- remote: {
- host: 'http://otherhost:9200'
- },
- index: 'source',
- size: 10,
- query: {
- match: {
- test: 'data'
- }
- }
- },
- dest: {
- index: 'dest'
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/657cf67bbc48f3b8c7fa15e275a5ef72.asciidoc b/docs/examples/guide/657cf67bbc48f3b8c7fa15e275a5ef72.asciidoc
index c0677f3cf4..c19003cff0 100644
--- a/docs/examples/guide/657cf67bbc48f3b8c7fa15e275a5ef72.asciidoc
+++ b/docs/examples/guide/657cf67bbc48f3b8c7fa15e275a5ef72.asciidoc
@@ -6,7 +6,7 @@ response = client.cluster.put_component_template(
template: {
mappings: {
properties: {
- "host.name": {
+ 'host.name' => {
type: 'keyword'
}
}
diff --git a/docs/examples/guide/65e892a362d940e4a74965f21c15ca09.asciidoc b/docs/examples/guide/65e892a362d940e4a74965f21c15ca09.asciidoc
new file mode 100644
index 0000000000..41754cb744
--- /dev/null
+++ b/docs/examples/guide/65e892a362d940e4a74965f21c15ca09.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.reindex(
+ wait_for_completion: false,
+ body: {
+ source: {
+ index: 'test-data',
+ size: 50
+ },
+ dest: {
+ index: 'openai-embeddings',
+ pipeline: 'openai_embeddings'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/6606d46685d10377b996b5f20f1229b5.asciidoc b/docs/examples/guide/6606d46685d10377b996b5f20f1229b5.asciidoc
new file mode 100644
index 0000000000..53dc0cf460
--- /dev/null
+++ b/docs/examples/guide/6606d46685d10377b996b5f20f1229b5.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.connector.update_index_name(
+ connector_id: 'my-connector',
+ body: {
+ index_name: 'data-from-my-google-drive'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/66c64bffe3a15cf260baa0c0118aa4ea.asciidoc b/docs/examples/guide/66c64bffe3a15cf260baa0c0118aa4ea.asciidoc
deleted file mode 100644
index 0db9a2f14a..0000000000
--- a/docs/examples/guide/66c64bffe3a15cf260baa0c0118aa4ea.asciidoc
+++ /dev/null
@@ -1,7 +0,0 @@
-[source, ruby]
-----
-response = client.enrich.execute_policy(
- name: 'my-policy'
-)
-puts response
-----
diff --git a/docs/examples/guide/682336e5232c9ad3d866cb203d1c58c1.asciidoc b/docs/examples/guide/682336e5232c9ad3d866cb203d1c58c1.asciidoc
new file mode 100644
index 0000000000..e8846eef91
--- /dev/null
+++ b/docs/examples/guide/682336e5232c9ad3d866cb203d1c58c1.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'azure-openai-embeddings',
+ body: {
+ mappings: {
+ properties: {
+ content_embedding: {
+ type: 'dense_vector',
+ dims: 1536,
+ element_type: 'float',
+ similarity: 'dot_product'
+ },
+ content: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/6843d859e2965d17cad4f033c81db83f.asciidoc b/docs/examples/guide/6843d859e2965d17cad4f033c81db83f.asciidoc
new file mode 100644
index 0000000000..2ee2a2cd46
--- /dev/null
+++ b/docs/examples/guide/6843d859e2965d17cad4f033c81db83f.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'my-data-stream-template',
+ body: {
+ index_patterns: [
+ 'my-data-stream*'
+ ],
+ data_stream: {},
+ priority: 500,
+ template: {
+ settings: {
+ 'sort.field' => [
+ '@timestamp'
+ ],
+ 'sort.order' => [
+ 'desc'
+ ]
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/6856f7c6a732ab55ca71c1ee2ec2bbad.asciidoc b/docs/examples/guide/6856f7c6a732ab55ca71c1ee2ec2bbad.asciidoc
index 38fd9ee855..7d703f6c47 100644
--- a/docs/examples/guide/6856f7c6a732ab55ca71c1ee2ec2bbad.asciidoc
+++ b/docs/examples/guide/6856f7c6a732ab55ca71c1ee2ec2bbad.asciidoc
@@ -19,7 +19,7 @@ response = client.index(
id: 1,
refresh: true,
body: {
- "network.name": 'net-1',
+ 'network.name' => 'net-1',
latency_histo: {
values: [
0.1,
@@ -45,7 +45,7 @@ response = client.index(
id: 2,
refresh: true,
body: {
- "network.name": 'net-2',
+ 'network.name' => 'net-2',
latency_histo: {
values: [
0.1,
diff --git a/docs/examples/guide/6894596e924b6180bfc77428ba89769f.asciidoc b/docs/examples/guide/6894596e924b6180bfc77428ba89769f.asciidoc
deleted file mode 100644
index a2364c6792..0000000000
--- a/docs/examples/guide/6894596e924b6180bfc77428ba89769f.asciidoc
+++ /dev/null
@@ -1,31 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'image-index',
- body: {
- mappings: {
- properties: {
- "image-vector": {
- type: 'dense_vector',
- dims: 3,
- index: true,
- similarity: 'l2_norm'
- },
- "title-vector": {
- type: 'dense_vector',
- dims: 5,
- index: true,
- similarity: 'l2_norm'
- },
- title: {
- type: 'text'
- },
- "file-type": {
- type: 'keyword'
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/692606cc6d6462becc321d92961a3bac.asciidoc b/docs/examples/guide/692606cc6d6462becc321d92961a3bac.asciidoc
new file mode 100644
index 0000000000..5c2ccaeef8
--- /dev/null
+++ b/docs/examples/guide/692606cc6d6462becc321d92961a3bac.asciidoc
@@ -0,0 +1,13 @@
+[source, ruby]
+----
+response = client.text_structure.test_grok_pattern(
+ body: {
+ grok_pattern: 'Hello %{WORD:first_name} %{WORD:last_name}',
+ text: [
+ 'Hello John Doe',
+ 'this does not match'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/698e0a2b67ba7842caa801d9ef46ebe3.asciidoc b/docs/examples/guide/698e0a2b67ba7842caa801d9ef46ebe3.asciidoc
index 6c7b87e34c..8122a10ef3 100644
--- a/docs/examples/guide/698e0a2b67ba7842caa801d9ef46ebe3.asciidoc
+++ b/docs/examples/guide/698e0a2b67ba7842caa801d9ef46ebe3.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
diff --git a/docs/examples/guide/69d9b8fd364596aa37eae6864d8a6d89.asciidoc b/docs/examples/guide/69d9b8fd364596aa37eae6864d8a6d89.asciidoc
index 9d6669c3d0..6e4b5cb2d9 100644
--- a/docs/examples/guide/69d9b8fd364596aa37eae6864d8a6d89.asciidoc
+++ b/docs/examples/guide/69d9b8fd364596aa37eae6864d8a6d89.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
sort: [
{
- "result.execution_time": 'desc'
+ 'result.execution_time' => 'desc'
}
]
}
diff --git a/docs/examples/guide/6a3a578ce37fb2c63ccfab7f75db9bae.asciidoc b/docs/examples/guide/6a3a578ce37fb2c63ccfab7f75db9bae.asciidoc
index fadbfec9dc..f3a30d6ace 100644
--- a/docs/examples/guide/6a3a578ce37fb2c63ccfab7f75db9bae.asciidoc
+++ b/docs/examples/guide/6a3a578ce37fb2c63ccfab7f75db9bae.asciidoc
@@ -3,8 +3,8 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "ingest.geoip.downloader.enabled": false,
- "indices.lifecycle.history_index_enabled": false
+ 'ingest.geoip.downloader.enabled' => false,
+ 'indices.lifecycle.history_index_enabled' => false
}
}
)
diff --git a/docs/examples/guide/6aa2941855d13f365f70aa8767ecb137.asciidoc b/docs/examples/guide/6aa2941855d13f365f70aa8767ecb137.asciidoc
index 444945ae1a..735e95268d 100644
--- a/docs/examples/guide/6aa2941855d13f365f70aa8767ecb137.asciidoc
+++ b/docs/examples/guide/6aa2941855d13f365f70aa8767ecb137.asciidoc
@@ -46,7 +46,7 @@ response = client.search(
}
},
sort: {
- "city.raw": 'asc'
+ 'city.raw' => 'asc'
},
aggregations: {
"Cities": {
diff --git a/docs/examples/guide/6af9dc1c3240aa8e623ff3622bcb1b48.asciidoc b/docs/examples/guide/6af9dc1c3240aa8e623ff3622bcb1b48.asciidoc
index fae4bd7ec7..24cec3e577 100644
--- a/docs/examples/guide/6af9dc1c3240aa8e623ff3622bcb1b48.asciidoc
+++ b/docs/examples/guide/6af9dc1c3240aa8e623ff3622bcb1b48.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.exclude._ip": '192.168.2.*'
+ 'cluster.routing.allocation.exclude._ip' => '192.168.2.*'
}
}
)
diff --git a/docs/examples/guide/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc b/docs/examples/guide/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc
new file mode 100644
index 0000000000..d3fd22a7a7
--- /dev/null
+++ b/docs/examples/guide/6b8c5c8145c287c4fc535fa57ccf95a7.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.sync_job_list(
+ status: 'pending'
+)
+puts response
+----
diff --git a/docs/examples/guide/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc b/docs/examples/guide/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc
index e5d610f46c..cb4d64e948 100644
--- a/docs/examples/guide/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc
+++ b/docs/examples/guide/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc
@@ -12,12 +12,12 @@ response = client.search(
},
{
match: {
- "title.original": 'quick brown fox'
+ 'title.original' => 'quick brown fox'
}
},
{
match: {
- "title.shingles": 'quick brown fox'
+ 'title.shingles' => 'quick brown fox'
}
}
]
diff --git a/docs/examples/guide/6c72f6791ba9223943f7556c5bfaa728.asciidoc b/docs/examples/guide/6c72f6791ba9223943f7556c5bfaa728.asciidoc
index 4a22713d9e..5cb5c17ec4 100644
--- a/docs/examples/guide/6c72f6791ba9223943f7556c5bfaa728.asciidoc
+++ b/docs/examples/guide/6c72f6791ba9223943f7556c5bfaa728.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
fields: [
diff --git a/docs/examples/guide/6cd083045bf06e80b83889a939a18451.asciidoc b/docs/examples/guide/6cd083045bf06e80b83889a939a18451.asciidoc
index 26d04bf588..4e3c9675a1 100644
--- a/docs/examples/guide/6cd083045bf06e80b83889a939a18451.asciidoc
+++ b/docs/examples/guide/6cd083045bf06e80b83889a939a18451.asciidoc
@@ -44,12 +44,12 @@ response = client.search(
must: [
{
match: {
- "user.first": 'Alice'
+ 'user.first' => 'Alice'
}
},
{
match: {
- "user.last": 'Smith'
+ 'user.last' => 'Smith'
}
}
]
@@ -72,12 +72,12 @@ response = client.search(
must: [
{
match: {
- "user.first": 'Alice'
+ 'user.first' => 'Alice'
}
},
{
match: {
- "user.last": 'White'
+ 'user.last' => 'White'
}
}
]
@@ -86,7 +86,7 @@ response = client.search(
inner_hits: {
highlight: {
fields: {
- "user.first": {}
+ 'user.first' => {}
}
}
}
diff --git a/docs/examples/guide/6cf3307c00f464c46475e352e067d714.asciidoc b/docs/examples/guide/6cf3307c00f464c46475e352e067d714.asciidoc
index d6910c7aa2..97ada0749d 100644
--- a/docs/examples/guide/6cf3307c00f464c46475e352e067d714.asciidoc
+++ b/docs/examples/guide/6cf3307c00f464c46475e352e067d714.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
},
filter: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
top_left: {
lat: 40.73,
lon: -74.1
diff --git a/docs/examples/guide/6e1ae8d6103e0b77f14fb0ea1bfb7ffa.asciidoc b/docs/examples/guide/6e1ae8d6103e0b77f14fb0ea1bfb7ffa.asciidoc
new file mode 100644
index 0000000000..b9e5cc79c0
--- /dev/null
+++ b/docs/examples/guide/6e1ae8d6103e0b77f14fb0ea1bfb7ffa.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'GEOMETRYCOLLECTION (POINT (1000.0 100.0), LINESTRING (1001.0 100.0, 1002.0 100.0))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/6ea062455229151e311869a81ee40252.asciidoc b/docs/examples/guide/6ea062455229151e311869a81ee40252.asciidoc
index ad44163eb6..c597c84956 100644
--- a/docs/examples/guide/6ea062455229151e311869a81ee40252.asciidoc
+++ b/docs/examples/guide/6ea062455229151e311869a81ee40252.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
@@ -16,7 +16,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
@@ -28,7 +28,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/6edfc35a66afd9b884431fccf48fdbf5.asciidoc b/docs/examples/guide/6edfc35a66afd9b884431fccf48fdbf5.asciidoc
new file mode 100644
index 0000000000..474dddba52
--- /dev/null
+++ b/docs/examples/guide/6edfc35a66afd9b884431fccf48fdbf5.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.indices.analyze(
+ body: {
+ tokenizer: 'standard',
+ filter: [
+ 'lowercase',
+ {
+ type: 'synonym_graph',
+ synonyms: [
+ 'pc => personal computer',
+ 'computer, pc, laptop'
+ ]
+ }
+ ],
+ text: 'Check how PC synonyms work'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/6f2208e90810ea6da751fe25fcf456ec.asciidoc b/docs/examples/guide/6f2208e90810ea6da751fe25fcf456ec.asciidoc
deleted file mode 100644
index b16b009d0c..0000000000
--- a/docs/examples/guide/6f2208e90810ea6da751fe25fcf456ec.asciidoc
+++ /dev/null
@@ -1,84 +0,0 @@
-[source, ruby]
-----
-response = client.index(
- index: 'metrics_index',
- id: 1,
- body: {
- "network.name": 'net-1',
- latency_histo: {
- values: [
- 1,
- 3,
- 8,
- 12,
- 15
- ],
- counts: [
- 3,
- 7,
- 23,
- 12,
- 6
- ]
- }
- }
-)
-puts response
-
-response = client.index(
- index: 'metrics_index',
- id: 2,
- body: {
- "network.name": 'net-2',
- latency_histo: {
- values: [
- 1,
- 6,
- 8,
- 12,
- 14
- ],
- counts: [
- 8,
- 17,
- 8,
- 7,
- 6
- ]
- }
- }
-)
-puts response
-
-response = client.search(
- index: 'metrics_index',
- size: 0,
- filter_path: 'aggregations',
- body: {
- aggregations: {
- latency_ranges: {
- range: {
- field: 'latency_histo',
- ranges: [
- {
- to: 2
- },
- {
- from: 2,
- to: 3
- },
- {
- from: 3,
- to: 10
- },
- {
- from: 10
- }
- ]
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/6f5adbd55a3a2760e7fe9d32df18b1a1.asciidoc b/docs/examples/guide/6f5adbd55a3a2760e7fe9d32df18b1a1.asciidoc
new file mode 100644
index 0000000000..589c3faf80
--- /dev/null
+++ b/docs/examples/guide/6f5adbd55a3a2760e7fe9d32df18b1a1.asciidoc
@@ -0,0 +1,13 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'logs',
+ body: {
+ timestamp: '2015-05-17T18:12:07.613Z',
+ request: 'GET index.html',
+ status_code: 404,
+ message: 'Error: File not found'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/6fbbf40cab0187f544ff7bca31d18d57.asciidoc b/docs/examples/guide/6fbbf40cab0187f544ff7bca31d18d57.asciidoc
new file mode 100644
index 0000000000..fce927f338
--- /dev/null
+++ b/docs/examples/guide/6fbbf40cab0187f544ff7bca31d18d57.asciidoc
@@ -0,0 +1,58 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'Polygon',
+ coordinates: [
+ [
+ [
+ 100,
+ 0
+ ],
+ [
+ 101,
+ 0
+ ],
+ [
+ 101,
+ 1
+ ],
+ [
+ 100,
+ 1
+ ],
+ [
+ 100,
+ 0
+ ]
+ ],
+ [
+ [
+ 100.2,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.2
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/6fd82baa17a48e09e3d2eed514af7f46.asciidoc b/docs/examples/guide/6fd82baa17a48e09e3d2eed514af7f46.asciidoc
new file mode 100644
index 0000000000..1b94f68c05
--- /dev/null
+++ b/docs/examples/guide/6fd82baa17a48e09e3d2eed514af7f46.asciidoc
@@ -0,0 +1,68 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'MultiLineString',
+ coordinates: [
+ [
+ [
+ 102,
+ 2
+ ],
+ [
+ 103,
+ 2
+ ],
+ [
+ 103,
+ 3
+ ],
+ [
+ 102,
+ 3
+ ]
+ ],
+ [
+ [
+ 100,
+ 0
+ ],
+ [
+ 101,
+ 0
+ ],
+ [
+ 101,
+ 1
+ ],
+ [
+ 100,
+ 1
+ ]
+ ],
+ [
+ [
+ 100.2,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.2
+ ],
+ [
+ 100.8,
+ 0.8
+ ],
+ [
+ 100.2,
+ 0.8
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/7011fcdd231804f9c3894154ae2c3fbc.asciidoc b/docs/examples/guide/7011fcdd231804f9c3894154ae2c3fbc.asciidoc
new file mode 100644
index 0000000000..24da6ea4c5
--- /dev/null
+++ b/docs/examples/guide/7011fcdd231804f9c3894154ae2c3fbc.asciidoc
@@ -0,0 +1,16 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index',
+ body: {
+ mappings: {
+ properties: {
+ 'text.tokens' => {
+ type: 'sparse_vector'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/7067a498bb6c788854a26443a64b843a.asciidoc b/docs/examples/guide/7067a498bb6c788854a26443a64b843a.asciidoc
index 668aae3272..fc0773bed3 100644
--- a/docs/examples/guide/7067a498bb6c788854a26443a64b843a.asciidoc
+++ b/docs/examples/guide/7067a498bb6c788854a26443a64b843a.asciidoc
@@ -3,7 +3,7 @@
response = client.search(
body: {
runtime_mappings: {
- "amount.signed": {
+ 'amount.signed' => {
type: 'double',
script: "\n double amount = doc['amount'].value;\n if (doc['type'].value == 'expense') {\n amount *= -1;\n }\n emit(amount);\n "
}
@@ -12,7 +12,7 @@ response = client.search(
bool: {
filter: {
range: {
- "amount.signed": {
+ 'amount.signed' => {
lt: 10
}
}
diff --git a/docs/examples/guide/711443504b69d0d296e717c716a223e2.asciidoc b/docs/examples/guide/711443504b69d0d296e717c716a223e2.asciidoc
index 9cc3a1c9b2..fbab109146 100644
--- a/docs/examples/guide/711443504b69d0d296e717c716a223e2.asciidoc
+++ b/docs/examples/guide/711443504b69d0d296e717c716a223e2.asciidoc
@@ -14,12 +14,12 @@ response = client.search(
must: [
{
match: {
- "driver.vehicle.make": 'Powell Motors'
+ 'driver.vehicle.make' => 'Powell Motors'
}
},
{
match: {
- "driver.vehicle.model": 'Canyonero'
+ 'driver.vehicle.model' => 'Canyonero'
}
}
]
diff --git a/docs/examples/guide/72a3668ddc95d9aec47cc679d1e7afc5.asciidoc b/docs/examples/guide/72a3668ddc95d9aec47cc679d1e7afc5.asciidoc
new file mode 100644
index 0000000000..a5e4bdb3ea
--- /dev/null
+++ b/docs/examples/guide/72a3668ddc95d9aec47cc679d1e7afc5.asciidoc
@@ -0,0 +1,31 @@
+[source, ruby]
+----
+response = client.cluster.put_settings(
+ body: {
+ persistent: {
+ cluster: {
+ remote: {
+ cluster_one: {
+ seeds: [
+ '35.238.149.1:9300'
+ ],
+ skip_unavailable: true
+ },
+ cluster_two: {
+ seeds: [
+ '35.238.149.2:9300'
+ ],
+ skip_unavailable: false
+ },
+ cluster_three: {
+ seeds: [
+ '35.238.149.3:9300'
+ ]
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/73250f845738c428246a3ade66a8f54c.asciidoc b/docs/examples/guide/73250f845738c428246a3ade66a8f54c.asciidoc
index 08acec51c1..78d1509e59 100644
--- a/docs/examples/guide/73250f845738c428246a3ade66a8f54c.asciidoc
+++ b/docs/examples/guide/73250f845738c428246a3ade66a8f54c.asciidoc
@@ -29,7 +29,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "weight.combined": {
+ 'weight.combined' => {
type: 'double',
script: "\n double s = 0;\n for (double w : doc['weight']) {\n s += w;\n }\n emit(s);\n "
}
diff --git a/docs/examples/guide/7353d42289155bb864504fd62efc6979.asciidoc b/docs/examples/guide/7353d42289155bb864504fd62efc6979.asciidoc
new file mode 100644
index 0000000000..541412dae2
--- /dev/null
+++ b/docs/examples/guide/7353d42289155bb864504fd62efc6979.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-image-index',
+ body: {
+ size: 3,
+ query: {
+ knn: {
+ field: 'image-vector',
+ query_vector: [
+ -5,
+ 9,
+ -12
+ ],
+ num_candidates: 10
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/73be1f93d789264e5b972ddb5991bc66.asciidoc b/docs/examples/guide/73be1f93d789264e5b972ddb5991bc66.asciidoc
index 97a5797419..ddaf86b2a1 100644
--- a/docs/examples/guide/73be1f93d789264e5b972ddb5991bc66.asciidoc
+++ b/docs/examples/guide/73be1f93d789264e5b972ddb5991bc66.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "logger.org.elasticsearch.discovery": 'DEBUG'
+ 'logger.org.elasticsearch.discovery' => 'DEBUG'
}
}
)
diff --git a/docs/examples/guide/73ebc89cb32adb389ae16bb088d7c7e6.asciidoc b/docs/examples/guide/73ebc89cb32adb389ae16bb088d7c7e6.asciidoc
index f894cb224b..2296b26fd4 100644
--- a/docs/examples/guide/73ebc89cb32adb389ae16bb088d7c7e6.asciidoc
+++ b/docs/examples/guide/73ebc89cb32adb389ae16bb088d7c7e6.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.enable": nil
+ 'cluster.routing.allocation.enable' => nil
}
}
)
diff --git a/docs/examples/guide/7456ef459d510d66ba4492cc9fbdc6c6.asciidoc b/docs/examples/guide/7456ef459d510d66ba4492cc9fbdc6c6.asciidoc
index 2913c0d787..7f77edf783 100644
--- a/docs/examples/guide/7456ef459d510d66ba4492cc9fbdc6c6.asciidoc
+++ b/docs/examples/guide/7456ef459d510d66ba4492cc9fbdc6c6.asciidoc
@@ -9,7 +9,7 @@ response = client.cluster.put_settings(
mode: nil,
seeds: nil,
skip_unavailable: nil,
- "transport.compress": nil
+ 'transport.compress' => nil
}
}
}
diff --git a/docs/examples/guide/747a4b5001423938d7d05399d28f1995.asciidoc b/docs/examples/guide/747a4b5001423938d7d05399d28f1995.asciidoc
index f1a516a9e3..a388fcf38a 100644
--- a/docs/examples/guide/747a4b5001423938d7d05399d28f1995.asciidoc
+++ b/docs/examples/guide/747a4b5001423938d7d05399d28f1995.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "indices.lifecycle.poll_interval": '1m'
+ 'indices.lifecycle.poll_interval' => '1m'
}
}
)
diff --git a/docs/examples/guide/74da377bccad43da2b0e276c086d26ba.asciidoc b/docs/examples/guide/74da377bccad43da2b0e276c086d26ba.asciidoc
new file mode 100644
index 0000000000..2f9c916c48
--- /dev/null
+++ b/docs/examples/guide/74da377bccad43da2b0e276c086d26ba.asciidoc
@@ -0,0 +1,32 @@
+[source, ruby]
+----
+response = client.cluster.info(
+ target: '_all'
+)
+puts response
+
+response = client.cluster.info(
+ target: 'http'
+)
+puts response
+
+response = client.cluster.info(
+ target: 'ingest'
+)
+puts response
+
+response = client.cluster.info(
+ target: 'thread_pool'
+)
+puts response
+
+response = client.cluster.info(
+ target: 'script'
+)
+puts response
+
+response = client.cluster.info(
+ target: 'http,ingest'
+)
+puts response
+----
diff --git a/docs/examples/guide/75c2bb6bbeb70d263cb9a5c588e8298e.asciidoc b/docs/examples/guide/75c2bb6bbeb70d263cb9a5c588e8298e.asciidoc
deleted file mode 100644
index d19b25d283..0000000000
--- a/docs/examples/guide/75c2bb6bbeb70d263cb9a5c588e8298e.asciidoc
+++ /dev/null
@@ -1,23 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'byte-image-index',
- body: {
- mappings: {
- properties: {
- "byte-image-vector": {
- type: 'dense_vector',
- element_type: 'byte',
- dims: 2,
- index: true,
- similarity: 'cosine'
- },
- title: {
- type: 'text'
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/75c347b181112d2c4538c01ade903afe.asciidoc b/docs/examples/guide/75c347b181112d2c4538c01ade903afe.asciidoc
index 210ad8e32c..87a6ce8cf2 100644
--- a/docs/examples/guide/75c347b181112d2c4538c01ade903afe.asciidoc
+++ b/docs/examples/guide/75c347b181112d2c4538c01ade903afe.asciidoc
@@ -6,7 +6,7 @@ response = client.indices.validate_query(
body: {
query: {
match: {
- "user.id": {
+ 'user.id' => {
query: 'kimchy',
fuzziness: 'auto'
}
diff --git a/docs/examples/guide/75e229852d1404040bb2e83723c0f1db.asciidoc b/docs/examples/guide/75e229852d1404040bb2e83723c0f1db.asciidoc
deleted file mode 100644
index e158dbf7ca..0000000000
--- a/docs/examples/guide/75e229852d1404040bb2e83723c0f1db.asciidoc
+++ /dev/null
@@ -1,14 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- index: 'customer',
- body: {
- query: {
- match: {
- firstname: 'Jennifer'
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/763ce1377c8dfa1ca6a042d8ee99f4f5.asciidoc b/docs/examples/guide/763ce1377c8dfa1ca6a042d8ee99f4f5.asciidoc
new file mode 100644
index 0000000000..2d38c96984
--- /dev/null
+++ b/docs/examples/guide/763ce1377c8dfa1ca6a042d8ee99f4f5.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.indices.rollover(
+ alias: 'k9s'
+)
+puts response
+----
diff --git a/docs/examples/guide/76c167d8ab305cb43b594f140c902dfe.asciidoc b/docs/examples/guide/76c167d8ab305cb43b594f140c902dfe.asciidoc
index 645b18d17d..1096e55f6b 100644
--- a/docs/examples/guide/76c167d8ab305cb43b594f140c902dfe.asciidoc
+++ b/docs/examples/guide/76c167d8ab305cb43b594f140c902dfe.asciidoc
@@ -5,9 +5,9 @@ response = client.indices.shrink(
target: 'my_target_index',
body: {
settings: {
- "index.number_of_replicas": 1,
- "index.number_of_shards": 1,
- "index.codec": 'best_compression'
+ 'index.number_of_replicas' => 1,
+ 'index.number_of_shards' => 1,
+ 'index.codec' => 'best_compression'
},
aliases: {
my_search_indices: {}
diff --git a/docs/examples/guide/77518e8c6198acfe77c0934fd2fe65cb.asciidoc b/docs/examples/guide/77518e8c6198acfe77c0934fd2fe65cb.asciidoc
new file mode 100644
index 0000000000..ea938fe04b
--- /dev/null
+++ b/docs/examples/guide/77518e8c6198acfe77c0934fd2fe65cb.asciidoc
@@ -0,0 +1,32 @@
+[source, ruby]
+----
+response = client.text_structure.find_message_structure(
+ body: {
+ messages: [
+ '[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128',
+ '[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]',
+ '[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]',
+ '[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]',
+ '[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]',
+ '[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]',
+ '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]',
+ '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]',
+ '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]',
+ '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]',
+ '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]',
+ '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]',
+ '[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]',
+ '[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]',
+ '[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]',
+ '[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled',
+ '[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled',
+ '[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled',
+ '[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]',
+ '[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]',
+ '[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized',
+ '[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/78e20b4cff470ed7357de1fd74bcfeb7.asciidoc b/docs/examples/guide/78e20b4cff470ed7357de1fd74bcfeb7.asciidoc
new file mode 100644
index 0000000000..b8e9fdf7cc
--- /dev/null
+++ b/docs/examples/guide/78e20b4cff470ed7357de1fd74bcfeb7.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.indices.update_aliases(
+ body: {
+ actions: [
+ {
+ remove: {
+ index: 'index1',
+ alias: 'logs-non-existing'
+ }
+ },
+ {
+ add: {
+ index: 'index2',
+ alias: 'logs-non-existing'
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/790c49fe2ec638e5e8db51a9236bba35.asciidoc b/docs/examples/guide/790c49fe2ec638e5e8db51a9236bba35.asciidoc
index 3a498a77b6..ea327204d5 100644
--- a/docs/examples/guide/790c49fe2ec638e5e8db51a9236bba35.asciidoc
+++ b/docs/examples/guide/790c49fe2ec638e5e8db51a9236bba35.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
},
filter: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
top_left: {
lat: 40.73,
lon: -74.1
diff --git a/docs/examples/guide/79e8bbbd6c440a21b0b4260c8cb1a61c.asciidoc b/docs/examples/guide/79e8bbbd6c440a21b0b4260c8cb1a61c.asciidoc
new file mode 100644
index 0000000000..1a46160372
--- /dev/null
+++ b/docs/examples/guide/79e8bbbd6c440a21b0b4260c8cb1a61c.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'LINESTRING (-77.03653 38.897676, -77.009051 38.889939)'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/79feb4a0c0a21b7015a52f9736cd4683.asciidoc b/docs/examples/guide/79feb4a0c0a21b7015a52f9736cd4683.asciidoc
index 31807ef9ce..5aa84331b4 100644
--- a/docs/examples/guide/79feb4a0c0a21b7015a52f9736cd4683.asciidoc
+++ b/docs/examples/guide/79feb4a0c0a21b7015a52f9736cd4683.asciidoc
@@ -58,7 +58,7 @@ response = client.search(
path: 'comments.votes',
query: {
match: {
- "comments.votes.voter": 'kimchy'
+ 'comments.votes.voter' => 'kimchy'
}
},
inner_hits: {}
diff --git a/docs/examples/guide/7b3e913368e96eaa6e22e0d03c81310e.asciidoc b/docs/examples/guide/7b3e913368e96eaa6e22e0d03c81310e.asciidoc
index c8ce52a6ab..fea4b10462 100644
--- a/docs/examples/guide/7b3e913368e96eaa6e22e0d03c81310e.asciidoc
+++ b/docs/examples/guide/7b3e913368e96eaa6e22e0d03c81310e.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.create(
index: 'my-index-000001',
body: {
settings: {
- "index.store.type": 'hybridfs'
+ 'index.store.type' => 'hybridfs'
}
}
)
diff --git a/docs/examples/guide/7b7a828c21c856a3cbc41fd2f85108bf.asciidoc b/docs/examples/guide/7b7a828c21c856a3cbc41fd2f85108bf.asciidoc
index ae39efe336..bfe7b4214e 100644
--- a/docs/examples/guide/7b7a828c21c856a3cbc41fd2f85108bf.asciidoc
+++ b/docs/examples/guide/7b7a828c21c856a3cbc41fd2f85108bf.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
body: {
query: {
range: {
- "http.response.bytes": {
+ 'http.response.bytes' => {
lt: 2_000_000
}
}
diff --git a/docs/examples/guide/7c2b45de463c8c5a06e933b1793b584b.asciidoc b/docs/examples/guide/7c2b45de463c8c5a06e933b1793b584b.asciidoc
deleted file mode 100644
index 14bcc33dea..0000000000
--- a/docs/examples/guide/7c2b45de463c8c5a06e933b1793b584b.asciidoc
+++ /dev/null
@@ -1,38 +0,0 @@
-[source, ruby]
-----
-response = client.cluster.put_component_template(
- name: 'my-weather-sensor-mappings',
- body: {
- template: {
- mappings: {
- properties: {
- sensor_id: {
- type: 'keyword',
- time_series_dimension: true
- },
- location: {
- type: 'keyword',
- time_series_dimension: true
- },
- temperature: {
- type: 'half_float',
- time_series_metric: 'gauge'
- },
- humidity: {
- type: 'half_float',
- time_series_metric: 'gauge'
- },
- "@timestamp": {
- type: 'date',
- format: 'strict_date_optional_time'
- }
- }
- }
- },
- _meta: {
- description: 'Mappings for weather sensor data'
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/7c8f207e43115ea8f20d2298be5aaebc.asciidoc b/docs/examples/guide/7c8f207e43115ea8f20d2298be5aaebc.asciidoc
new file mode 100644
index 0000000000..9a73648d67
--- /dev/null
+++ b/docs/examples/guide/7c8f207e43115ea8f20d2298be5aaebc.asciidoc
@@ -0,0 +1,36 @@
+[source, ruby]
+----
+response = client.simulate.ingest(
+ body: {
+ docs: [
+ {
+ _index: 'my-index',
+ _id: 'id',
+ _source: {
+ foo: 'bar'
+ }
+ },
+ {
+ _index: 'my-index',
+ _id: 'id',
+ _source: {
+ foo: 'rab'
+ }
+ }
+ ],
+ pipeline_substitutions: {
+ "my-pipeline": {
+ processors: [
+ {
+ set: {
+ field: 'field3',
+ value: 'value3'
+ }
+ }
+ ]
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/7d3ffd32f2747efb7d0fb1f0dc617ff4.asciidoc b/docs/examples/guide/7d3ffd32f2747efb7d0fb1f0dc617ff4.asciidoc
deleted file mode 100644
index ce117d4c25..0000000000
--- a/docs/examples/guide/7d3ffd32f2747efb7d0fb1f0dc617ff4.asciidoc
+++ /dev/null
@@ -1,26 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'test_index',
- body: {
- settings: {
- index: {
- analysis: {
- filter: {
- synonym: {
- type: 'synonym',
- format: 'wordnet',
- synonyms: [
- "s(100000001,1,'abstain',v,1,0).",
- "s(100000001,2,'refrain',v,1,0).",
- "s(100000001,3,'desist',v,1,0)."
- ]
- }
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/7e48648ca27024831c60b455e836c496.asciidoc b/docs/examples/guide/7e48648ca27024831c60b455e836c496.asciidoc
new file mode 100644
index 0000000000..86a64fc64d
--- /dev/null
+++ b/docs/examples/guide/7e48648ca27024831c60b455e836c496.asciidoc
@@ -0,0 +1,26 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ query: {
+ pinned: {
+ docs: [
+ {
+ _index: 'my-index-000001',
+ _id: '1'
+ },
+ {
+ _id: '4'
+ }
+ ],
+ organic: {
+ match: {
+ description: 'iphone'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/7f697eb436dfa3c30dfe610d8c32d132.asciidoc b/docs/examples/guide/7f697eb436dfa3c30dfe610d8c32d132.asciidoc
deleted file mode 100644
index a975cb57d0..0000000000
--- a/docs/examples/guide/7f697eb436dfa3c30dfe610d8c32d132.asciidoc
+++ /dev/null
@@ -1,24 +0,0 @@
-[source, ruby]
-----
-response = client.reindex(
- body: {
- source: {
- remote: {
- host: 'http://otherhost:9200',
- socket_timeout: '1m',
- connect_timeout: '10s'
- },
- index: 'source',
- query: {
- match: {
- test: 'data'
- }
- }
- },
- dest: {
- index: 'dest'
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/7fe9f0a583e079f7fc6fd64d12b6e9e5.asciidoc b/docs/examples/guide/7fe9f0a583e079f7fc6fd64d12b6e9e5.asciidoc
index 0b4e314432..22721e0621 100644
--- a/docs/examples/guide/7fe9f0a583e079f7fc6fd64d12b6e9e5.asciidoc
+++ b/docs/examples/guide/7fe9f0a583e079f7fc6fd64d12b6e9e5.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
size: 0,
body: {
runtime_mappings: {
- "price.weighted": {
+ 'price.weighted' => {
type: 'double',
script: "\n double price = doc['price'].value;\n if (doc['promoted'].value) {\n price *= 0.8;\n }\n emit(price);\n "
}
diff --git a/docs/examples/guide/80edd2124a822d9f9bf22ecc49d2c2e9.asciidoc b/docs/examples/guide/80edd2124a822d9f9bf22ecc49d2c2e9.asciidoc
new file mode 100644
index 0000000000..a7f8eeaa34
--- /dev/null
+++ b/docs/examples/guide/80edd2124a822d9f9bf22ecc49d2c2e9.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.synonyms.get_synonym_rule(
+ set_id: 'my-synonyms-set',
+ rule_id: 'test-1'
+)
+puts response
+----
diff --git a/docs/examples/guide/81612c2537386e031b7eb604f6756a71.asciidoc b/docs/examples/guide/81612c2537386e031b7eb604f6756a71.asciidoc
index 8824a16df7..4db274b124 100644
--- a/docs/examples/guide/81612c2537386e031b7eb604f6756a71.asciidoc
+++ b/docs/examples/guide/81612c2537386e031b7eb604f6756a71.asciidoc
@@ -5,7 +5,7 @@ response = client.indices.clone(
target: 'my_target_index',
body: {
settings: {
- "index.number_of_shards": 5
+ 'index.number_of_shards' => 5
},
aliases: {
my_search_indices: {}
diff --git a/docs/examples/guide/8194f1fae6aa72ab91ea559daad932d4.asciidoc b/docs/examples/guide/8194f1fae6aa72ab91ea559daad932d4.asciidoc
index aa8bd31262..7b23195fec 100644
--- a/docs/examples/guide/8194f1fae6aa72ab91ea559daad932d4.asciidoc
+++ b/docs/examples/guide/8194f1fae6aa72ab91ea559daad932d4.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/819e00cc6547d925d80090b94e0650d7.asciidoc b/docs/examples/guide/819e00cc6547d925d80090b94e0650d7.asciidoc
index 2ebb8a7559..85d352a923 100644
--- a/docs/examples/guide/819e00cc6547d925d80090b94e0650d7.asciidoc
+++ b/docs/examples/guide/819e00cc6547d925d80090b94e0650d7.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
_source: [
diff --git a/docs/examples/guide/8206a7cc615ad93fec322513b8fdd4fd.asciidoc b/docs/examples/guide/8206a7cc615ad93fec322513b8fdd4fd.asciidoc
new file mode 100644
index 0000000000..20cd926790
--- /dev/null
+++ b/docs/examples/guide/8206a7cc615ad93fec322513b8fdd4fd.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'job-candidates',
+ id: 2,
+ refresh: true,
+ body: {
+ name: 'Jason Response',
+ programming_languages: [
+ 'java',
+ 'php'
+ ],
+ required_matches: 2
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/820f689eaaef15fc07abd1073fa880f8.asciidoc b/docs/examples/guide/820f689eaaef15fc07abd1073fa880f8.asciidoc
index 610639a4b6..3a68cccb2f 100644
--- a/docs/examples/guide/820f689eaaef15fc07abd1073fa880f8.asciidoc
+++ b/docs/examples/guide/820f689eaaef15fc07abd1073fa880f8.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
size: 20,
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/84490ee2c6c07dbd2101ce2e3751e1aa.asciidoc b/docs/examples/guide/84490ee2c6c07dbd2101ce2e3751e1aa.asciidoc
new file mode 100644
index 0000000000..c3f423d9bf
--- /dev/null
+++ b/docs/examples/guide/84490ee2c6c07dbd2101ce2e3751e1aa.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.reindex(
+ wait_for_completion: false,
+ body: {
+ source: {
+ index: 'test-data',
+ size: 50
+ },
+ dest: {
+ index: 'cohere-embeddings',
+ pipeline: 'cohere_embeddings'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/844928da2ff9a1394af5347a5e2e4f78.asciidoc b/docs/examples/guide/844928da2ff9a1394af5347a5e2e4f78.asciidoc
index 213478f0d9..43ed7d73c0 100644
--- a/docs/examples/guide/844928da2ff9a1394af5347a5e2e4f78.asciidoc
+++ b/docs/examples/guide/844928da2ff9a1394af5347a5e2e4f78.asciidoc
@@ -3,11 +3,11 @@
response = client.indices.put_settings(
index: 'my-index-000001',
body: {
- "index.indexing.slowlog.threshold.index.warn": '10s',
- "index.indexing.slowlog.threshold.index.info": '5s',
- "index.indexing.slowlog.threshold.index.debug": '2s',
- "index.indexing.slowlog.threshold.index.trace": '500ms',
- "index.indexing.slowlog.source": '1000'
+ 'index.indexing.slowlog.threshold.index.warn' => '10s',
+ 'index.indexing.slowlog.threshold.index.info' => '5s',
+ 'index.indexing.slowlog.threshold.index.debug' => '2s',
+ 'index.indexing.slowlog.threshold.index.trace' => '500ms',
+ 'index.indexing.slowlog.source' => '1000'
}
)
puts response
diff --git a/docs/examples/guide/84f3e8524f6ff80e870c03ab71551538.asciidoc b/docs/examples/guide/84f3e8524f6ff80e870c03ab71551538.asciidoc
index 12e721f93c..48a97dd3c2 100644
--- a/docs/examples/guide/84f3e8524f6ff80e870c03ab71551538.asciidoc
+++ b/docs/examples/guide/84f3e8524f6ff80e870c03ab71551538.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/850bfd0a00d32475a54ac7f87fb4cc4d.asciidoc b/docs/examples/guide/850bfd0a00d32475a54ac7f87fb4cc4d.asciidoc
new file mode 100644
index 0000000000..c1f28b57bb
--- /dev/null
+++ b/docs/examples/guide/850bfd0a00d32475a54ac7f87fb4cc4d.asciidoc
@@ -0,0 +1,25 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index-000001',
+ body: {
+ runtime_mappings: {
+ 'measures.voltage' => {
+ type: 'double',
+ script: {
+ source: "if (doc['model_number.keyword'].value.equals('HG537PU'))\n {emit(1.7 * params._source['measures']['voltage']);}\n else{emit(params._source['measures']['voltage']);}"
+ }
+ }
+ },
+ query: {
+ match: {
+ model_number: 'HG537PU'
+ }
+ },
+ fields: [
+ 'measures.voltage'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/85519a614ae18c998986d46bbad82b76.asciidoc b/docs/examples/guide/85519a614ae18c998986d46bbad82b76.asciidoc
index c4dff197e6..6a687a5c7a 100644
--- a/docs/examples/guide/85519a614ae18c998986d46bbad82b76.asciidoc
+++ b/docs/examples/guide/85519a614ae18c998986d46bbad82b76.asciidoc
@@ -10,8 +10,8 @@ response = client.indices.put_index_template(
settings: {
number_of_shards: 1,
number_of_replicas: 1,
- "index.lifecycle.name": 'my_policy',
- "index.lifecycle.rollover_alias": 'test-alias'
+ 'index.lifecycle.name' => 'my_policy',
+ 'index.lifecycle.rollover_alias' => 'test-alias'
}
}
}
diff --git a/docs/examples/guide/856c10ad554c26b70f1121454caff40a.asciidoc b/docs/examples/guide/856c10ad554c26b70f1121454caff40a.asciidoc
new file mode 100644
index 0000000000..f0ffaae57a
--- /dev/null
+++ b/docs/examples/guide/856c10ad554c26b70f1121454caff40a.asciidoc
@@ -0,0 +1,18 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'byte-image-index',
+ body: {
+ knn: {
+ field: 'byte-image-vector',
+ query_vector: 'fb09',
+ k: 10,
+ num_candidates: 100
+ },
+ fields: [
+ 'title'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/8575c966b004fb124c7afd6bb5827b50.asciidoc b/docs/examples/guide/8575c966b004fb124c7afd6bb5827b50.asciidoc
new file mode 100644
index 0000000000..e85d828755
--- /dev/null
+++ b/docs/examples/guide/8575c966b004fb124c7afd6bb5827b50.asciidoc
@@ -0,0 +1,13 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'books',
+ body: {
+ name: 'Snow Crash',
+ author: 'Neal Stephenson',
+ release_date: '1992-06-01',
+ page_count: 470
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/8582e918a6275472d2eba2e95f1dbe77.asciidoc b/docs/examples/guide/8582e918a6275472d2eba2e95f1dbe77.asciidoc
index ea1b4705f6..d9c5bd0e03 100644
--- a/docs/examples/guide/8582e918a6275472d2eba2e95f1dbe77.asciidoc
+++ b/docs/examples/guide/8582e918a6275472d2eba2e95f1dbe77.asciidoc
@@ -3,14 +3,14 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.disk.watermark.low": '90%',
- "cluster.routing.allocation.disk.watermark.low.max_headroom": '100GB',
- "cluster.routing.allocation.disk.watermark.high": '95%',
- "cluster.routing.allocation.disk.watermark.high.max_headroom": '20GB',
- "cluster.routing.allocation.disk.watermark.flood_stage": '97%',
- "cluster.routing.allocation.disk.watermark.flood_stage.max_headroom": '5GB',
- "cluster.routing.allocation.disk.watermark.flood_stage.frozen": '97%',
- "cluster.routing.allocation.disk.watermark.flood_stage.frozen.max_headroom": '5GB'
+ 'cluster.routing.allocation.disk.watermark.low' => '90%',
+ 'cluster.routing.allocation.disk.watermark.low.max_headroom' => '100GB',
+ 'cluster.routing.allocation.disk.watermark.high' => '95%',
+ 'cluster.routing.allocation.disk.watermark.high.max_headroom' => '20GB',
+ 'cluster.routing.allocation.disk.watermark.flood_stage' => '97%',
+ 'cluster.routing.allocation.disk.watermark.flood_stage.max_headroom' => '5GB',
+ 'cluster.routing.allocation.disk.watermark.flood_stage.frozen' => '97%',
+ 'cluster.routing.allocation.disk.watermark.flood_stage.frozen.max_headroom' => '5GB'
}
}
)
@@ -20,7 +20,7 @@ response = client.indices.put_settings(
index: '*',
expand_wildcards: 'all',
body: {
- "index.blocks.read_only_allow_delete": nil
+ 'index.blocks.read_only_allow_delete' => nil
}
)
puts response
diff --git a/docs/examples/guide/863253bf0ab7d227ff72a0a384f4de8c.asciidoc b/docs/examples/guide/863253bf0ab7d227ff72a0a384f4de8c.asciidoc
index 59e12dc8bc..ade82466df 100644
--- a/docs/examples/guide/863253bf0ab7d227ff72a0a384f4de8c.asciidoc
+++ b/docs/examples/guide/863253bf0ab7d227ff72a0a384f4de8c.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "indices.lifecycle.poll_interval": nil
+ 'indices.lifecycle.poll_interval' => nil
}
}
)
diff --git a/docs/examples/guide/867f7d43a78066731ead2e223960fc07.asciidoc b/docs/examples/guide/867f7d43a78066731ead2e223960fc07.asciidoc
index 7e90c71357..83c0726045 100644
--- a/docs/examples/guide/867f7d43a78066731ead2e223960fc07.asciidoc
+++ b/docs/examples/guide/867f7d43a78066731ead2e223960fc07.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "action.destructive_requires_name": false
+ 'action.destructive_requires_name' => false
}
}
)
diff --git a/docs/examples/guide/8703f3b1b3895543abc36e2a7a0013d3.asciidoc b/docs/examples/guide/8703f3b1b3895543abc36e2a7a0013d3.asciidoc
index df27435751..420db430b5 100644
--- a/docs/examples/guide/8703f3b1b3895543abc36e2a7a0013d3.asciidoc
+++ b/docs/examples/guide/8703f3b1b3895543abc36e2a7a0013d3.asciidoc
@@ -14,7 +14,7 @@ response = client.indices.create(
index: 'index_3',
body: {
settings: {
- "index.priority": 10
+ 'index.priority' => 10
}
}
)
@@ -24,7 +24,7 @@ response = client.indices.create(
index: 'index_4',
body: {
settings: {
- "index.priority": 5
+ 'index.priority' => 5
}
}
)
diff --git a/docs/examples/guide/87416e6a1ca2da324dbed6deb05303eb.asciidoc b/docs/examples/guide/87416e6a1ca2da324dbed6deb05303eb.asciidoc
index 7c7389a3f0..6f14013326 100644
--- a/docs/examples/guide/87416e6a1ca2da324dbed6deb05303eb.asciidoc
+++ b/docs/examples/guide/87416e6a1ca2da324dbed6deb05303eb.asciidoc
@@ -5,7 +5,7 @@ response = client.index(
id: 1,
refresh: true,
body: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
)
puts response
@@ -21,7 +21,7 @@ response = client.count(
body: {
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/88b19973b970adf9b73fca82017d4951.asciidoc b/docs/examples/guide/88b19973b970adf9b73fca82017d4951.asciidoc
index deb1b100fd..280dfb3ffa 100644
--- a/docs/examples/guide/88b19973b970adf9b73fca82017d4951.asciidoc
+++ b/docs/examples/guide/88b19973b970adf9b73fca82017d4951.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/89d2a3748dc14c6d5d4c6f94b9b03938.asciidoc b/docs/examples/guide/89d2a3748dc14c6d5d4c6f94b9b03938.asciidoc
new file mode 100644
index 0000000000..70ef33abaf
--- /dev/null
+++ b/docs/examples/guide/89d2a3748dc14c6d5d4c6f94b9b03938.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.indices.add_block(
+ index: 'my_source_index',
+ block: 'write'
+)
+puts response
+----
diff --git a/docs/examples/guide/89dee10a24ea2727af5b00039a4271bd.asciidoc b/docs/examples/guide/89dee10a24ea2727af5b00039a4271bd.asciidoc
new file mode 100644
index 0000000000..36b9db8182
--- /dev/null
+++ b/docs/examples/guide/89dee10a24ea2727af5b00039a4271bd.asciidoc
@@ -0,0 +1,162 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'tour',
+ body: {
+ mappings: {
+ properties: {
+ city: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ category: {
+ type: 'keyword'
+ },
+ route: {
+ type: 'long'
+ },
+ name: {
+ type: 'keyword'
+ },
+ location: {
+ type: 'geo_point'
+ },
+ "@timestamp": {
+ type: 'date'
+ }
+ }
+ },
+ settings: {
+ index: {
+ mode: 'time_series',
+ routing_path: [
+ 'city'
+ ],
+ time_series: {
+ start_time: '2023-01-01T00:00:00Z',
+ end_time: '2024-01-01T00:00:00Z'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.bulk(
+ index: 'tour',
+ refresh: true,
+ body: [
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-02T09:00:00Z',
+ route: 0,
+ location: 'POINT(4.889187 52.373184)',
+ city: 'Amsterdam',
+ category: 'Attraction',
+ name: 'Royal Palace Amsterdam'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-02T10:00:00Z',
+ route: 1,
+ location: 'POINT(4.885057 52.370159)',
+ city: 'Amsterdam',
+ category: 'Attraction',
+ name: 'The Amsterdam Dungeon'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-02T13:00:00Z',
+ route: 2,
+ location: 'POINT(4.901618 52.369219)',
+ city: 'Amsterdam',
+ category: 'Museum',
+ name: 'Museum Het Rembrandthuis'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-02T16:00:00Z',
+ route: 3,
+ location: 'POINT(4.912350 52.374081)',
+ city: 'Amsterdam',
+ category: 'Museum',
+ name: 'NEMO Science Museum'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-03T12:00:00Z',
+ route: 4,
+ location: 'POINT(4.914722 52.371667)',
+ city: 'Amsterdam',
+ category: 'Museum',
+ name: 'Nederlands Scheepvaartmuseum'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-04T09:00:00Z',
+ route: 5,
+ location: 'POINT(4.401384 51.220292)',
+ city: 'Antwerp',
+ category: 'Attraction',
+ name: 'Cathedral of Our Lady'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-04T12:00:00Z',
+ route: 6,
+ location: 'POINT(4.405819 51.221758)',
+ city: 'Antwerp',
+ category: 'Museum',
+ name: 'Snijders&Rockoxhuis'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-04T15:00:00Z',
+ route: 7,
+ location: 'POINT(4.405200 51.222900)',
+ city: 'Antwerp',
+ category: 'Museum',
+ name: 'Letterenhuis'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-05T10:00:00Z',
+ route: 8,
+ location: 'POINT(2.336389 48.861111)',
+ city: 'Paris',
+ category: 'Museum',
+ name: 'Musée du Louvre'
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-01-05T14:00:00Z',
+ route: 9,
+ location: 'POINT(2.327000 48.860000)',
+ city: 'Paris',
+ category: 'Museum',
+ name: 'Musée dOrsay'
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/8b301122cbf42be6eafeda714a36559e.asciidoc b/docs/examples/guide/8b301122cbf42be6eafeda714a36559e.asciidoc
new file mode 100644
index 0000000000..ad59d2c541
--- /dev/null
+++ b/docs/examples/guide/8b301122cbf42be6eafeda714a36559e.asciidoc
@@ -0,0 +1,25 @@
+[source, ruby]
+----
+response = client.logstash.put_pipeline(
+ id: 'my_pipeline',
+ body: {
+ description: 'Sample pipeline for illustration purposes',
+ last_modified: '2021-01-02T02:50:51.250Z',
+ pipeline_metadata: {
+ type: 'logstash_pipeline',
+ version: '1'
+ },
+ username: 'elastic',
+ pipeline: "input {}\n filter { grok {} }\n output {}",
+ pipeline_settings: {
+ 'pipeline.workers' => 1,
+ 'pipeline.batch.size' => 125,
+ 'pipeline.batch.delay' => 50,
+ 'queue.type' => 'memory',
+ 'queue.max_bytes' => '1gb',
+ 'queue.checkpoint.writes' => 1024
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/8b7956a2b88fd798a895d3466d671b58.asciidoc b/docs/examples/guide/8b7956a2b88fd798a895d3466d671b58.asciidoc
index d7c32d6de8..031541c239 100644
--- a/docs/examples/guide/8b7956a2b88fd798a895d3466d671b58.asciidoc
+++ b/docs/examples/guide/8b7956a2b88fd798a895d3466d671b58.asciidoc
@@ -3,8 +3,8 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "http.tracer.include": '*',
- "http.tracer.exclude": ''
+ 'http.tracer.include' => '*',
+ 'http.tracer.exclude' => ''
}
}
)
diff --git a/docs/examples/guide/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc b/docs/examples/guide/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc
new file mode 100644
index 0000000000..ba63948337
--- /dev/null
+++ b/docs/examples/guide/8bf1e7a6d529547906ba8b1d6501fa0c.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.connector.sync_job_error(
+ connector_sync_job_id: 'my-connector-sync-job',
+ body: {
+ error: 'some-error'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/8c619666488927dac6ecb7dcebca44c2.asciidoc b/docs/examples/guide/8c619666488927dac6ecb7dcebca44c2.asciidoc
new file mode 100644
index 0000000000..623878106b
--- /dev/null
+++ b/docs/examples/guide/8c619666488927dac6ecb7dcebca44c2.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'cohere-embeddings',
+ body: {
+ mappings: {
+ properties: {
+ content_embedding: {
+ type: 'dense_vector',
+ dims: 1024,
+ element_type: 'byte'
+ },
+ content: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/8d064eda2199de52e5be9ee68a5b7c68.asciidoc b/docs/examples/guide/8d064eda2199de52e5be9ee68a5b7c68.asciidoc
new file mode 100644
index 0000000000..8059cf7cea
--- /dev/null
+++ b/docs/examples/guide/8d064eda2199de52e5be9ee68a5b7c68.asciidoc
@@ -0,0 +1,23 @@
+[source, ruby]
+----
+response = client.ingest.put_pipeline(
+ id: 'my-text-embeddings-pipeline',
+ body: {
+ description: 'Text embedding pipeline',
+ processors: [
+ {
+ inference: {
+ model_id: '.elser_model_2',
+ input_output: [
+ {
+ input_field: 'my_text_field',
+ output_field: 'my_tokens'
+ }
+ ]
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/8d421c5bec38eecce4679b219cacc9db.asciidoc b/docs/examples/guide/8d421c5bec38eecce4679b219cacc9db.asciidoc
index 43956146fa..b89963631f 100644
--- a/docs/examples/guide/8d421c5bec38eecce4679b219cacc9db.asciidoc
+++ b/docs/examples/guide/8d421c5bec38eecce4679b219cacc9db.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "load_time.seconds": {
+ 'load_time.seconds' => {
type: 'long',
script: {
source: "emit(doc['load_time'].value / params.timeUnit)",
diff --git a/docs/examples/guide/8d7193902a353872740a3324c60c5001.asciidoc b/docs/examples/guide/8d7193902a353872740a3324c60c5001.asciidoc
index bfd706f083..4d7923342e 100644
--- a/docs/examples/guide/8d7193902a353872740a3324c60c5001.asciidoc
+++ b/docs/examples/guide/8d7193902a353872740a3324c60c5001.asciidoc
@@ -5,8 +5,8 @@ response = client.indices.create(
body: {
settings: {
index: {
- "sort.field": 'timestamp',
- "sort.order": 'desc'
+ 'sort.field' => 'timestamp',
+ 'sort.order' => 'desc'
}
},
mappings: {
diff --git a/docs/examples/guide/8d9b04f2a97f4229dec9e620126de049.asciidoc b/docs/examples/guide/8d9b04f2a97f4229dec9e620126de049.asciidoc
new file mode 100644
index 0000000000..f474f9b86f
--- /dev/null
+++ b/docs/examples/guide/8d9b04f2a97f4229dec9e620126de049.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.cluster.put_settings(
+ body: {
+ persistent: {
+ 'logger.com.amazonaws.request' => 'DEBUG'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/8e286a205a1f84f888a6d99f2620c80e.asciidoc b/docs/examples/guide/8e286a205a1f84f888a6d99f2620c80e.asciidoc
index 2d08ee5400..59b020a4a3 100644
--- a/docs/examples/guide/8e286a205a1f84f888a6d99f2620c80e.asciidoc
+++ b/docs/examples/guide/8e286a205a1f84f888a6d99f2620c80e.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "logger.org.elasticsearch.deprecation": 'OFF'
+ 'logger.org.elasticsearch.deprecation' => 'OFF'
}
}
)
diff --git a/docs/examples/guide/8e89fee0be6a436c4e3d7c152659c47e.asciidoc b/docs/examples/guide/8e89fee0be6a436c4e3d7c152659c47e.asciidoc
new file mode 100644
index 0000000000..412cbd8e26
--- /dev/null
+++ b/docs/examples/guide/8e89fee0be6a436c4e3d7c152659c47e.asciidoc
@@ -0,0 +1,23 @@
+[source, ruby]
+----
+response = client.connector.update_scheduling(
+ connector_id: 'my-connector',
+ body: {
+ scheduling: {
+ access_control: {
+ enabled: true,
+ interval: '0 10 0 * * ?'
+ },
+ full: {
+ enabled: true,
+ interval: '0 20 0 * * ?'
+ },
+ incremental: {
+ enabled: false,
+ interval: '0 30 0 * * ?'
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/8f0c5c81cdb902c136db821947ee70a1.asciidoc b/docs/examples/guide/8f0c5c81cdb902c136db821947ee70a1.asciidoc
index 9d8c1a9970..29f8328a5c 100644
--- a/docs/examples/guide/8f0c5c81cdb902c136db821947ee70a1.asciidoc
+++ b/docs/examples/guide/8f0c5c81cdb902c136db821947ee70a1.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "price.adjusted": {
+ 'price.adjusted' => {
type: 'double',
script: "\n double price = doc['price'].value;\n if (doc['promoted'].value) {\n price *= 0.8;\n }\n emit(price);\n "
}
diff --git a/docs/examples/guide/8f7936f219500305e5b2518dbbf949ea.asciidoc b/docs/examples/guide/8f7936f219500305e5b2518dbbf949ea.asciidoc
new file mode 100644
index 0000000000..8eb8cd85ab
--- /dev/null
+++ b/docs/examples/guide/8f7936f219500305e5b2518dbbf949ea.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.async_search.status(
+ id: 'FmpwbThueVB4UkRDeUxqb1l4akIza3cbWEJyeVBPQldTV3FGZGdIeUVabXBldzoyMDIw'
+)
+puts response
+----
diff --git a/docs/examples/guide/8fec06a98d0151c1d717a01491d0b8f0.asciidoc b/docs/examples/guide/8fec06a98d0151c1d717a01491d0b8f0.asciidoc
new file mode 100644
index 0000000000..6626475dae
--- /dev/null
+++ b/docs/examples/guide/8fec06a98d0151c1d717a01491d0b8f0.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'dsl-data-stream',
+ body: {
+ "@timestamp": '2023-10-18T16:21:15.000Z',
+ message: '192.0.2.42 - - [06/May/2099:16:21:15 +0000] "GET /images/bg.jpg HTTP/1.0" 200 24736'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/90083d93e46fad2524755b8d4d1306fc.asciidoc b/docs/examples/guide/90083d93e46fad2524755b8d4d1306fc.asciidoc
new file mode 100644
index 0000000000..06608f987c
--- /dev/null
+++ b/docs/examples/guide/90083d93e46fad2524755b8d4d1306fc.asciidoc
@@ -0,0 +1,14 @@
+[source, ruby]
+----
+response = client.connector.sync_job_update_stats(
+ connector_sync_job_id: 'my-connector-sync-job',
+ body: {
+ deleted_document_count: 10,
+ indexed_document_count: 20,
+ indexed_document_volume: 1000,
+ total_document_count: 2000,
+ last_seen: '2023-01-02T10:00:00Z'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/90112d594b934c0111b7303b9f91cb7f.asciidoc b/docs/examples/guide/90112d594b934c0111b7303b9f91cb7f.asciidoc
deleted file mode 100644
index 22fea04517..0000000000
--- a/docs/examples/guide/90112d594b934c0111b7303b9f91cb7f.asciidoc
+++ /dev/null
@@ -1,12 +0,0 @@
-[source, ruby]
-----
-response = client.index(
- index: 'customer',
- id: 1,
- body: {
- firstname: 'Jennifer',
- lastname: 'Walters'
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/902cfd5aeec2f65b3adf55f5e38b21f0.asciidoc b/docs/examples/guide/902cfd5aeec2f65b3adf55f5e38b21f0.asciidoc
new file mode 100644
index 0000000000..31de8448f8
--- /dev/null
+++ b/docs/examples/guide/902cfd5aeec2f65b3adf55f5e38b21f0.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'kibana_sample_data_ecommerce2',
+ body: {
+ user: 'kimchy'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/909a032a9c1f7095b798444705b09ad6.asciidoc b/docs/examples/guide/909a032a9c1f7095b798444705b09ad6.asciidoc
new file mode 100644
index 0000000000..48852d5949
--- /dev/null
+++ b/docs/examples/guide/909a032a9c1f7095b798444705b09ad6.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'GEOMETRYCOLLECTION (POINT (100.0 0.0), LINESTRING (101.0 0.0, 102.0 1.0))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/92d343eb755971c44a939d0660bf5ac2.asciidoc b/docs/examples/guide/92d343eb755971c44a939d0660bf5ac2.asciidoc
new file mode 100644
index 0000000000..2810b67022
--- /dev/null
+++ b/docs/examples/guide/92d343eb755971c44a939d0660bf5ac2.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'test',
+ id: 1,
+ refresh: true,
+ body: {
+ test: 'test'
+ }
+)
+puts response
+
+response = client.index(
+ index: 'test',
+ id: 2,
+ refresh: true,
+ body: {
+ test: 'test'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/2cafbc456bed3b7c8780e5557aab1d6b.asciidoc b/docs/examples/guide/93cca1eb4d9ee4c65ab259e18469d9d6.asciidoc
similarity index 100%
rename from docs/examples/guide/2cafbc456bed3b7c8780e5557aab1d6b.asciidoc
rename to docs/examples/guide/93cca1eb4d9ee4c65ab259e18469d9d6.asciidoc
diff --git a/docs/examples/guide/93cd0fdd5ca22838db06aa1cabdbe8bd.asciidoc b/docs/examples/guide/93cd0fdd5ca22838db06aa1cabdbe8bd.asciidoc
new file mode 100644
index 0000000000..6c8e28514c
--- /dev/null
+++ b/docs/examples/guide/93cd0fdd5ca22838db06aa1cabdbe8bd.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'hugging-face-embeddings',
+ body: {
+ knn: {
+ field: 'content_embedding',
+ query_vector_builder: {
+ text_embedding: {
+ model_id: 'hugging_face_embeddings',
+ model_text: "What's margin of error?"
+ }
+ },
+ k: 10,
+ num_candidates: 100
+ },
+ _source: [
+ 'id',
+ 'content'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/93d7ba4130722cae04f9690e52a8f54f.asciidoc b/docs/examples/guide/93d7ba4130722cae04f9690e52a8f54f.asciidoc
new file mode 100644
index 0000000000..fc118e7869
--- /dev/null
+++ b/docs/examples/guide/93d7ba4130722cae04f9690e52a8f54f.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'envelope',
+ coordinates: [
+ [
+ 100,
+ 1
+ ],
+ [
+ 101,
+ 0
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/94cd66bf93f99881c1bda547283a0357.asciidoc b/docs/examples/guide/94cd66bf93f99881c1bda547283a0357.asciidoc
new file mode 100644
index 0000000000..2373173148
--- /dev/null
+++ b/docs/examples/guide/94cd66bf93f99881c1bda547283a0357.asciidoc
@@ -0,0 +1,46 @@
+[source, ruby]
+----
+response = client.bulk(
+ index: 'quantized-image-index',
+ refresh: true,
+ body: [
+ {
+ index: {
+ _id: '1'
+ }
+ },
+ {
+ "image-vector": [
+ 0.1,
+ -2
+ ],
+ title: 'moose family'
+ },
+ {
+ index: {
+ _id: '2'
+ }
+ },
+ {
+ "image-vector": [
+ 0.75,
+ -1
+ ],
+ title: 'alpine lake'
+ },
+ {
+ index: {
+ _id: '3'
+ }
+ },
+ {
+ "image-vector": [
+ 1.2,
+ 0.1
+ ],
+ title: 'full moon'
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/9501e6c8e95c21838653ea15b9b7ed5f.asciidoc b/docs/examples/guide/9501e6c8e95c21838653ea15b9b7ed5f.asciidoc
index 24760e7df4..b8bf89c539 100644
--- a/docs/examples/guide/9501e6c8e95c21838653ea15b9b7ed5f.asciidoc
+++ b/docs/examples/guide/9501e6c8e95c21838653ea15b9b7ed5f.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
term: {
- "query.extraction_result": 'failed'
+ 'query.extraction_result' => 'failed'
}
}
}
diff --git a/docs/examples/guide/956cb470258024af964cd2dabbaf7c7c.asciidoc b/docs/examples/guide/956cb470258024af964cd2dabbaf7c7c.asciidoc
index 81c880d75c..97b8b27b64 100644
--- a/docs/examples/guide/956cb470258024af964cd2dabbaf7c7c.asciidoc
+++ b/docs/examples/guide/956cb470258024af964cd2dabbaf7c7c.asciidoc
@@ -3,8 +3,8 @@
response = client.indices.put_settings(
index: 'my-index',
body: {
- "index.routing.allocation.require.data": nil,
- "index.routing.allocation.include._tier_preference": 'data_warm,data_hot'
+ 'index.routing.allocation.require.data' => nil,
+ 'index.routing.allocation.include._tier_preference' => 'data_warm,data_hot'
}
)
puts response
diff --git a/docs/examples/guide/95c03bdef4faf6bef039c986f4cb3aba.asciidoc b/docs/examples/guide/95c03bdef4faf6bef039c986f4cb3aba.asciidoc
index 907339e3e7..89264f02cf 100644
--- a/docs/examples/guide/95c03bdef4faf6bef039c986f4cb3aba.asciidoc
+++ b/docs/examples/guide/95c03bdef4faf6bef039c986f4cb3aba.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
query: {
match: {
- "result.condition.met": true
+ 'result.condition.met' => true
}
}
}
diff --git a/docs/examples/guide/96b9289c3c4c6b135ab3386562c4ee8d.asciidoc b/docs/examples/guide/96b9289c3c4c6b135ab3386562c4ee8d.asciidoc
index c22ee2bed1..7f7016e5c3 100644
--- a/docs/examples/guide/96b9289c3c4c6b135ab3386562c4ee8d.asciidoc
+++ b/docs/examples/guide/96b9289c3c4c6b135ab3386562c4ee8d.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.max_shards_per_node": 1200
+ 'cluster.max_shards_per_node' => 1200
}
}
)
diff --git a/docs/examples/guide/96ea0e80323d6d2d99964625c004a44d.asciidoc b/docs/examples/guide/96ea0e80323d6d2d99964625c004a44d.asciidoc
new file mode 100644
index 0000000000..3d89ed2f22
--- /dev/null
+++ b/docs/examples/guide/96ea0e80323d6d2d99964625c004a44d.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.indices.put_data_lifecycle(
+ name: 'dsl-data-stream',
+ body: {
+ data_retention: '7d',
+ enabled: false
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/97f5df84efec655f479fad78bc392d4d.asciidoc b/docs/examples/guide/97f5df84efec655f479fad78bc392d4d.asciidoc
index f3a35a8297..e8d52a980f 100644
--- a/docs/examples/guide/97f5df84efec655f479fad78bc392d4d.asciidoc
+++ b/docs/examples/guide/97f5df84efec655f479fad78bc392d4d.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
profile: true,
query: {
term: {
- "user.id": {
+ 'user.id' => {
value: 'elkbee'
}
}
diff --git a/docs/examples/guide/983fbb78e57e8fe98db38cf2d217e943.asciidoc b/docs/examples/guide/983fbb78e57e8fe98db38cf2d217e943.asciidoc
index 2cb4aca699..41a31c1d5d 100644
--- a/docs/examples/guide/983fbb78e57e8fe98db38cf2d217e943.asciidoc
+++ b/docs/examples/guide/983fbb78e57e8fe98db38cf2d217e943.asciidoc
@@ -42,7 +42,7 @@ response = client.search(
path: 'comments',
query: {
match: {
- "comments.text": 'words'
+ 'comments.text' => 'words'
}
},
inner_hits: {
diff --git a/docs/examples/guide/98b403c356a9b14544e9b9f646845e9f.asciidoc b/docs/examples/guide/98b403c356a9b14544e9b9f646845e9f.asciidoc
new file mode 100644
index 0000000000..a113257b59
--- /dev/null
+++ b/docs/examples/guide/98b403c356a9b14544e9b9f646845e9f.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.put_script(
+ id: 'my-search-template',
+ body: {
+ script: {
+ lang: 'mustache',
+ source: {
+ query: {
+ multi_match: {
+ query: '{{query_string}}',
+ fields: '[{{#text_fields}}{{user_name}}{{^last}},{{/last}}{{/text_fields}}]'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/990c0d794ed6f05d1620b5d49f7aff6e.asciidoc b/docs/examples/guide/990c0d794ed6f05d1620b5d49f7aff6e.asciidoc
new file mode 100644
index 0000000000..1a8323c1ee
--- /dev/null
+++ b/docs/examples/guide/990c0d794ed6f05d1620b5d49f7aff6e.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.indices.get_data_lifecycle(
+ name: 'my-data-stream'
+)
+puts response
+----
diff --git a/docs/examples/guide/991b9ba53f0eccec8ec5a42f8d9b655c.asciidoc b/docs/examples/guide/991b9ba53f0eccec8ec5a42f8d9b655c.asciidoc
index 12202c8fb0..90467c2fbc 100644
--- a/docs/examples/guide/991b9ba53f0eccec8ec5a42f8d9b655c.asciidoc
+++ b/docs/examples/guide/991b9ba53f0eccec8ec5a42f8d9b655c.asciidoc
@@ -4,13 +4,13 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
fields: {
body: {},
- "blog.title": {
+ 'blog.title' => {
number_of_fragments: 0
}
}
diff --git a/docs/examples/guide/998651b98e152add530084a631a4ab5a.asciidoc b/docs/examples/guide/998651b98e152add530084a631a4ab5a.asciidoc
index f1a516a9e3..a388fcf38a 100644
--- a/docs/examples/guide/998651b98e152add530084a631a4ab5a.asciidoc
+++ b/docs/examples/guide/998651b98e152add530084a631a4ab5a.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "indices.lifecycle.poll_interval": '1m'
+ 'indices.lifecycle.poll_interval' => '1m'
}
}
)
diff --git a/docs/examples/guide/99b617a0a83fcfbe5755ccc724a4ce62.asciidoc b/docs/examples/guide/99b617a0a83fcfbe5755ccc724a4ce62.asciidoc
new file mode 100644
index 0000000000..8970b060ad
--- /dev/null
+++ b/docs/examples/guide/99b617a0a83fcfbe5755ccc724a4ce62.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'place_path_category',
+ id: 1,
+ body: {
+ suggest: [
+ "timmy's",
+ 'starbucks',
+ 'dunkin donuts'
+ ],
+ cat: [
+ 'cafe',
+ 'food'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc b/docs/examples/guide/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
index 73bd4a608f..70760c333e 100644
--- a/docs/examples/guide/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
+++ b/docs/examples/guide/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
@@ -5,7 +5,7 @@ response = client.index(
id: 1,
refresh: true,
body: {
- "system.cpu.idle.pct": 0.908
+ 'system.cpu.idle.pct' => 0.908
}
)
puts response
@@ -15,7 +15,7 @@ response = client.index(
id: 1,
refresh: true,
body: {
- "system.cpu.idle.pct": 0.105
+ 'system.cpu.idle.pct' => 0.105
}
)
puts response
diff --git a/docs/examples/guide/9aa2327ae315c39f2bce2bd22e0deb1b.asciidoc b/docs/examples/guide/9aa2327ae315c39f2bce2bd22e0deb1b.asciidoc
index 8d62dee41a..f0162ba4a2 100644
--- a/docs/examples/guide/9aa2327ae315c39f2bce2bd22e0deb1b.asciidoc
+++ b/docs/examples/guide/9aa2327ae315c39f2bce2bd22e0deb1b.asciidoc
@@ -9,12 +9,12 @@ response = client.search(
must: [
{
match: {
- "result.condition.met": true
+ 'result.condition.met' => true
}
},
{
range: {
- "result.execution_time": {
+ 'result.execution_time' => {
from: 'now-10s'
}
}
diff --git a/docs/examples/guide/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc b/docs/examples/guide/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc
new file mode 100644
index 0000000000..bb0b6a0db3
--- /dev/null
+++ b/docs/examples/guide/9b0f34d122a4b348dc86df7410d6ebb6.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.sync_job_cancel(
+ connector_sync_job_id: 'my-connector-sync-job-id'
+)
+puts response
+----
diff --git a/docs/examples/guide/9beb260834f8cfb240f6308950dbb9c2.asciidoc b/docs/examples/guide/9beb260834f8cfb240f6308950dbb9c2.asciidoc
index 94679c0064..0bc4d3a406 100644
--- a/docs/examples/guide/9beb260834f8cfb240f6308950dbb9c2.asciidoc
+++ b/docs/examples/guide/9beb260834f8cfb240f6308950dbb9c2.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
sort: [
{
_geo_distance: {
- "pin.location": 'drm3btev3e86',
+ 'pin.location' => 'drm3btev3e86',
order: 'asc',
unit: 'km'
}
diff --git a/docs/examples/guide/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc b/docs/examples/guide/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc
index 5b60e24e06..cce1d3cf75 100644
--- a/docs/examples/guide/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc
+++ b/docs/examples/guide/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc
@@ -7,7 +7,7 @@ response = client.delete_by_query(
body: {
query: {
range: {
- "http.response.bytes": {
+ 'http.response.bytes' => {
lt: 2_000_000
}
}
diff --git a/docs/examples/guide/9e563b8d5a7845f644db8d5bbf453eb6.asciidoc b/docs/examples/guide/9e563b8d5a7845f644db8d5bbf453eb6.asciidoc
new file mode 100644
index 0000000000..232e0d5c9d
--- /dev/null
+++ b/docs/examples/guide/9e563b8d5a7845f644db8d5bbf453eb6.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.synonyms.put_synonym(
+ id: 'my-synonyms-set',
+ body: {
+ synonyms_set: [
+ {
+ id: 'test-1',
+ synonyms: 'hello, hi'
+ },
+ {
+ synonyms: 'bye, goodbye'
+ },
+ {
+ id: 'test-2',
+ synonyms: 'test => check'
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/9f214a468014a83809935e7b808afc53.asciidoc b/docs/examples/guide/9f214a468014a83809935e7b808afc53.asciidoc
deleted file mode 100644
index ace423fa44..0000000000
--- a/docs/examples/guide/9f214a468014a83809935e7b808afc53.asciidoc
+++ /dev/null
@@ -1,31 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- body: {
- query: {
- pinned: {
- docs: [
- {
- _index: 'my-index-000001',
- _id: '1'
- },
- {
- _index: 'my-index-000001',
- _id: '4'
- },
- {
- _index: 'my-index-000002',
- _id: '100'
- }
- ],
- organic: {
- match: {
- description: 'iphone'
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/9f22a0920cc763eefa233ced963d9624.asciidoc b/docs/examples/guide/9f22a0920cc763eefa233ced963d9624.asciidoc
index a3af576f72..fe31c4fb37 100644
--- a/docs/examples/guide/9f22a0920cc763eefa233ced963d9624.asciidoc
+++ b/docs/examples/guide/9f22a0920cc763eefa233ced963d9624.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
span_term: {
- "user.id": {
+ 'user.id' => {
term: 'kimchy',
boost: 2
}
diff --git a/docs/examples/guide/9feff356f302ea4915347ab71cc4887a.asciidoc b/docs/examples/guide/9feff356f302ea4915347ab71cc4887a.asciidoc
index b48d9b2e4e..b8df274c04 100644
--- a/docs/examples/guide/9feff356f302ea4915347ab71cc4887a.asciidoc
+++ b/docs/examples/guide/9feff356f302ea4915347ab71cc4887a.asciidoc
@@ -11,7 +11,7 @@ response = client.indices.simulate_template(
priority: 10,
template: {
settings: {
- "index.number_of_replicas": 1
+ 'index.number_of_replicas' => 1
}
}
}
diff --git a/docs/examples/guide/a0497157fdefecd04e597edb800a1a95.asciidoc b/docs/examples/guide/a0497157fdefecd04e597edb800a1a95.asciidoc
index 408abd5f8c..35c9f3782d 100644
--- a/docs/examples/guide/a0497157fdefecd04e597edb800a1a95.asciidoc
+++ b/docs/examples/guide/a0497157fdefecd04e597edb800a1a95.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
_source: 'obj.*',
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/a0c64894f14d28b7e0c902add71d2e9a.asciidoc b/docs/examples/guide/a0c64894f14d28b7e0c902add71d2e9a.asciidoc
new file mode 100644
index 0000000000..9af8726e17
--- /dev/null
+++ b/docs/examples/guide/a0c64894f14d28b7e0c902add71d2e9a.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.cluster.put_settings(
+ body: {
+ persistent: {
+ 'xpack.profiling.templates.enabled' => true
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a0d53dcb3df938fc0a01d248571a41e4.asciidoc b/docs/examples/guide/a0d53dcb3df938fc0a01d248571a41e4.asciidoc
index a881ef5a09..a01190e805 100644
--- a/docs/examples/guide/a0d53dcb3df938fc0a01d248571a41e4.asciidoc
+++ b/docs/examples/guide/a0d53dcb3df938fc0a01d248571a41e4.asciidoc
@@ -3,7 +3,7 @@
response = client.search(
body: {
runtime_mappings: {
- "price.discounted": {
+ 'price.discounted' => {
type: 'double',
script: "\n double price = doc['price'].value;\n if (doc['product'].value == 'mad max') {\n price *= 0.8;\n }\n emit(price);\n "
}
diff --git a/docs/examples/guide/a1f6383373084d874d3365eef2c0e96e.asciidoc b/docs/examples/guide/a1f6383373084d874d3365eef2c0e96e.asciidoc
deleted file mode 100644
index 469fc34234..0000000000
--- a/docs/examples/guide/a1f6383373084d874d3365eef2c0e96e.asciidoc
+++ /dev/null
@@ -1,7 +0,0 @@
-[source, ruby]
-----
-response = client.indices.delete(
- index: 'sample-01'
-)
-puts response
-----
diff --git a/docs/examples/guide/a1f70bc71b763b58206814c40a7440e7.asciidoc b/docs/examples/guide/a1f70bc71b763b58206814c40a7440e7.asciidoc
index e6c9b5e937..273dbddda4 100644
--- a/docs/examples/guide/a1f70bc71b763b58206814c40a7440e7.asciidoc
+++ b/docs/examples/guide/a1f70bc71b763b58206814c40a7440e7.asciidoc
@@ -2,7 +2,7 @@
----
response = client.watcher.update_settings(
body: {
- "index.auto_expand_replicas": '0-4'
+ 'index.auto_expand_replicas' => '0-4'
}
)
puts response
diff --git a/docs/examples/guide/a2bd0782aadfd0a902d7f590ee7f49fe.asciidoc b/docs/examples/guide/a2bd0782aadfd0a902d7f590ee7f49fe.asciidoc
new file mode 100644
index 0000000000..d285e699fc
--- /dev/null
+++ b/docs/examples/guide/a2bd0782aadfd0a902d7f590ee7f49fe.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index',
+ body: {
+ mappings: {
+ properties: {
+ content_embedding: {
+ type: 'sparse_vector'
+ },
+ content: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a425fcab60f603504becee7d001f0a4b.asciidoc b/docs/examples/guide/a425fcab60f603504becee7d001f0a4b.asciidoc
index ee51e07015..c2fe7ecb23 100644
--- a/docs/examples/guide/a425fcab60f603504becee7d001f0a4b.asciidoc
+++ b/docs/examples/guide/a425fcab60f603504becee7d001f0a4b.asciidoc
@@ -3,7 +3,7 @@
response = client.indices.put_settings(
index: 'index_4',
body: {
- "index.priority": 1
+ 'index.priority' => 1
}
)
puts response
diff --git a/docs/examples/guide/a45d80a3fdba70c1b1ba493e51652c8a.asciidoc b/docs/examples/guide/a45d80a3fdba70c1b1ba493e51652c8a.asciidoc
new file mode 100644
index 0000000000..823884c927
--- /dev/null
+++ b/docs/examples/guide/a45d80a3fdba70c1b1ba493e51652c8a.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'multipoint',
+ coordinates: [
+ [
+ 1002,
+ 1002
+ ],
+ [
+ 1003,
+ 2000
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a4a3c3cd09efa75168dab90105afb2e9.asciidoc b/docs/examples/guide/a4a3c3cd09efa75168dab90105afb2e9.asciidoc
new file mode 100644
index 0000000000..e6a4f843ab
--- /dev/null
+++ b/docs/examples/guide/a4a3c3cd09efa75168dab90105afb2e9.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.inference.get_model(
+ task_type: 'sparse_embedding',
+ inference_id: 'my-elser-model'
+)
+puts response
+----
diff --git a/docs/examples/guide/a4f259522b4dc10a0323aff58236c2c2.asciidoc b/docs/examples/guide/a4f259522b4dc10a0323aff58236c2c2.asciidoc
new file mode 100644
index 0000000000..f72d60cf07
--- /dev/null
+++ b/docs/examples/guide/a4f259522b4dc10a0323aff58236c2c2.asciidoc
@@ -0,0 +1,18 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'music',
+ id: 1,
+ refresh: true,
+ body: {
+ suggest: {
+ input: [
+ 'Nevermind',
+ 'Nirvana'
+ ],
+ weight: 34
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a53ff77d83222c0e76453e630d64787e.asciidoc b/docs/examples/guide/a53ff77d83222c0e76453e630d64787e.asciidoc
new file mode 100644
index 0000000000..446177b2b5
--- /dev/null
+++ b/docs/examples/guide/a53ff77d83222c0e76453e630d64787e.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.ingest.put_pipeline(
+ id: 'openai_embeddings',
+ body: {
+ processors: [
+ {
+ inference: {
+ model_id: 'openai_embeddings',
+ input_output: {
+ input_field: 'content',
+ output_field: 'content_embedding'
+ }
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a547bb926c25f670078b98fbe67de3cc.asciidoc b/docs/examples/guide/a547bb926c25f670078b98fbe67de3cc.asciidoc
new file mode 100644
index 0000000000..d7ebbe1cb7
--- /dev/null
+++ b/docs/examples/guide/a547bb926c25f670078b98fbe67de3cc.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.synonyms.delete_synonym_rule(
+ set_id: 'my-synonyms-set',
+ rule_id: 'test-1'
+)
+puts response
+----
diff --git a/docs/examples/guide/a5e6ccfb6019238e6db602373b9af147.asciidoc b/docs/examples/guide/a5e6ccfb6019238e6db602373b9af147.asciidoc
new file mode 100644
index 0000000000..ea47306dc2
--- /dev/null
+++ b/docs/examples/guide/a5e6ccfb6019238e6db602373b9af147.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.indices.put_data_lifecycle(
+ name: 'my-data-stream',
+ body: {}
+)
+puts response
+----
diff --git a/docs/examples/guide/a62833baf15f2c9ac094a9289e56a012.asciidoc b/docs/examples/guide/a62833baf15f2c9ac094a9289e56a012.asciidoc
new file mode 100644
index 0000000000..721e75a76e
--- /dev/null
+++ b/docs/examples/guide/a62833baf15f2c9ac094a9289e56a012.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'timeseries',
+ body: {
+ message: 'logged the request',
+ "@timestamp": '1591890611'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a62fda257bdc3ffdd98f39cd38d112f1.asciidoc b/docs/examples/guide/a62fda257bdc3ffdd98f39cd38d112f1.asciidoc
deleted file mode 100644
index bf1d52a596..0000000000
--- a/docs/examples/guide/a62fda257bdc3ffdd98f39cd38d112f1.asciidoc
+++ /dev/null
@@ -1,29 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'test_index',
- body: {
- settings: {
- index: {
- analysis: {
- analyzer: {
- synonym: {
- tokenizer: 'whitespace',
- filter: [
- 'synonym'
- ]
- }
- },
- filter: {
- synonym: {
- type: 'synonym',
- synonyms_path: 'analysis/synonym.txt'
- }
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/a63e0d0504e0c9313814b7f4e2641353.asciidoc b/docs/examples/guide/a63e0d0504e0c9313814b7f4e2641353.asciidoc
new file mode 100644
index 0000000000..4c99bb36fe
--- /dev/null
+++ b/docs/examples/guide/a63e0d0504e0c9313814b7f4e2641353.asciidoc
@@ -0,0 +1,107 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'metrics_index',
+ body: {
+ mappings: {
+ properties: {
+ network: {
+ properties: {
+ name: {
+ type: 'keyword'
+ }
+ }
+ },
+ latency_histo: {
+ type: 'histogram'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'metrics_index',
+ id: 1,
+ refresh: true,
+ body: {
+ 'network.name' => 'net-1',
+ latency_histo: {
+ values: [
+ 1,
+ 3,
+ 8,
+ 12,
+ 15
+ ],
+ counts: [
+ 3,
+ 7,
+ 23,
+ 12,
+ 6
+ ]
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'metrics_index',
+ id: 2,
+ refresh: true,
+ body: {
+ 'network.name' => 'net-2',
+ latency_histo: {
+ values: [
+ 1,
+ 6,
+ 8,
+ 12,
+ 14
+ ],
+ counts: [
+ 8,
+ 17,
+ 8,
+ 7,
+ 6
+ ]
+ }
+ }
+)
+puts response
+
+response = client.search(
+ index: 'metrics_index',
+ size: 0,
+ filter_path: 'aggregations',
+ body: {
+ aggregations: {
+ latency_ranges: {
+ range: {
+ field: 'latency_histo',
+ ranges: [
+ {
+ to: 2
+ },
+ {
+ from: 2,
+ to: 3
+ },
+ {
+ from: 3,
+ to: 10
+ },
+ {
+ from: 10
+ }
+ ]
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a6b2815d54df34b6b8d00226e9a1af0c.asciidoc b/docs/examples/guide/a6b2815d54df34b6b8d00226e9a1af0c.asciidoc
new file mode 100644
index 0000000000..d57dc991c2
--- /dev/null
+++ b/docs/examples/guide/a6b2815d54df34b6b8d00226e9a1af0c.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index',
+ body: {
+ mappings: {
+ properties: {
+ 'my_embeddings.predicted_value' => {
+ type: 'dense_vector',
+ dims: 384
+ },
+ my_text_field: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a6ccac9f80c5e5efdaab992f3a32d919.asciidoc b/docs/examples/guide/a6ccac9f80c5e5efdaab992f3a32d919.asciidoc
new file mode 100644
index 0000000000..657939dede
--- /dev/null
+++ b/docs/examples/guide/a6ccac9f80c5e5efdaab992f3a32d919.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.indices.get_data_stream(
+ name: 'dsl-data-stream'
+)
+puts response
+----
diff --git a/docs/examples/guide/a735081e715d385b4d471eea0f2b57da.asciidoc b/docs/examples/guide/a735081e715d385b4d471eea0f2b57da.asciidoc
index eab23a6161..a53ca0b4b8 100644
--- a/docs/examples/guide/a735081e715d385b4d471eea0f2b57da.asciidoc
+++ b/docs/examples/guide/a735081e715d385b4d471eea0f2b57da.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "slm.retention_schedule": '0 30 1 * * ?'
+ 'slm.retention_schedule' => '0 30 1 * * ?'
}
}
)
diff --git a/docs/examples/guide/a73a9a6f19516b8ead63182a9ae5b540.asciidoc b/docs/examples/guide/a73a9a6f19516b8ead63182a9ae5b540.asciidoc
new file mode 100644
index 0000000000..4572bd40b9
--- /dev/null
+++ b/docs/examples/guide/a73a9a6f19516b8ead63182a9ae5b540.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'MULTILINESTRING ((1002.0 200.0, 1003.0 200.0, 1003.0 300.0, 1002.0 300.0), (1000.0 100.0, 1001.0 100.0, 1001.0 100.0, 1000.0 100.0), (1000.2 0.2, 1000.8 100.2, 1000.8 100.8, 1000.2 100.8))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a810da963d3b28d79dcd17be829bb271.asciidoc b/docs/examples/guide/a810da963d3b28d79dcd17be829bb271.asciidoc
index 54a70e04c0..41aab2f2eb 100644
--- a/docs/examples/guide/a810da963d3b28d79dcd17be829bb271.asciidoc
+++ b/docs/examples/guide/a810da963d3b28d79dcd17be829bb271.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
docvalue_fields: [
diff --git a/docs/examples/guide/a89052bcdfe40e604a98d12be6ae59d2.asciidoc b/docs/examples/guide/a89052bcdfe40e604a98d12be6ae59d2.asciidoc
new file mode 100644
index 0000000000..8e362dc364
--- /dev/null
+++ b/docs/examples/guide/a89052bcdfe40e604a98d12be6ae59d2.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'BBOX (100.0, 102.0, 2.0, 0.0)'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a8add749c3f41ad1308a45308df14103.asciidoc b/docs/examples/guide/a8add749c3f41ad1308a45308df14103.asciidoc
new file mode 100644
index 0000000000..fc67c30409
--- /dev/null
+++ b/docs/examples/guide/a8add749c3f41ad1308a45308df14103.asciidoc
@@ -0,0 +1,29 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'sales',
+ id: 1,
+ refresh: true,
+ body: {
+ tags: [
+ 'car',
+ 'auto'
+ ],
+ comments: [
+ {
+ username: 'baddriver007',
+ comment: 'This car could have better brakes'
+ },
+ {
+ username: 'dr_who',
+ comment: "Where's the autopilot? Can't find it"
+ },
+ {
+ username: 'ilovemotorbikes',
+ comment: 'This car has two extra wheels'
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/a941fd568f2e20e13df909ab24506073.asciidoc b/docs/examples/guide/a941fd568f2e20e13df909ab24506073.asciidoc
index cbbb572709..f8027fdd08 100644
--- a/docs/examples/guide/a941fd568f2e20e13df909ab24506073.asciidoc
+++ b/docs/examples/guide/a941fd568f2e20e13df909ab24506073.asciidoc
@@ -6,7 +6,7 @@ puts response
response = client.cluster.put_settings(
body: {
persistent: {
- "xpack.monitoring.collection.enabled": false
+ 'xpack.monitoring.collection.enabled' => false
}
}
)
diff --git a/docs/examples/guide/a9554396506888e392a1aee0ca28e6fc.asciidoc b/docs/examples/guide/a9554396506888e392a1aee0ca28e6fc.asciidoc
index 195cfb4f69..9c77b62780 100644
--- a/docs/examples/guide/a9554396506888e392a1aee0ca28e6fc.asciidoc
+++ b/docs/examples/guide/a9554396506888e392a1aee0ca28e6fc.asciidoc
@@ -20,7 +20,7 @@ response = client.indices.update_aliases(
},
{
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
]
diff --git a/docs/examples/guide/a960b43e720b4934edb74ab4b085ca77.asciidoc b/docs/examples/guide/a960b43e720b4934edb74ab4b085ca77.asciidoc
new file mode 100644
index 0000000000..124637796e
--- /dev/null
+++ b/docs/examples/guide/a960b43e720b4934edb74ab4b085ca77.asciidoc
@@ -0,0 +1,5 @@
+[source, ruby]
+----
+response = client.connector.list
+puts response
+----
diff --git a/docs/examples/guide/a99bf70ae38bdf1c6f350140b25e0422.asciidoc b/docs/examples/guide/a99bf70ae38bdf1c6f350140b25e0422.asciidoc
index 6f09d3d3bc..270145cd97 100644
--- a/docs/examples/guide/a99bf70ae38bdf1c6f350140b25e0422.asciidoc
+++ b/docs/examples/guide/a99bf70ae38bdf1c6f350140b25e0422.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/aaba346e0becdf12db13658296e0b8a1.asciidoc b/docs/examples/guide/aaba346e0becdf12db13658296e0b8a1.asciidoc
index ae00732886..d085b8a838 100644
--- a/docs/examples/guide/aaba346e0becdf12db13658296e0b8a1.asciidoc
+++ b/docs/examples/guide/aaba346e0becdf12db13658296e0b8a1.asciidoc
@@ -4,8 +4,8 @@ response = client.indices.create(
index: 'my-index-000001',
body: {
settings: {
- "index.number_of_shards": 2,
- "index.lifecycle.name": 'shrink-index'
+ 'index.number_of_shards' => 2,
+ 'index.lifecycle.name' => 'shrink-index'
}
}
)
diff --git a/docs/examples/guide/ab1372270c11bcd6f36d1a13e6c69276.asciidoc b/docs/examples/guide/ab1372270c11bcd6f36d1a13e6c69276.asciidoc
new file mode 100644
index 0000000000..e3b2dbd0df
--- /dev/null
+++ b/docs/examples/guide/ab1372270c11bcd6f36d1a13e6c69276.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.async_search.submit(
+ index: 'my-index-000001,cluster_one:my-index-000001,cluster_two:my-index-000001',
+ ccs_minimize_roundtrips: true,
+ body: {
+ query: {
+ match: {
+ 'user.id' => 'kimchy'
+ }
+ },
+ _source: [
+ 'user.id',
+ 'message',
+ 'http.response.status_code'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/ab1a989958c1d345a9dc3dd36ad90c27.asciidoc b/docs/examples/guide/ab1a989958c1d345a9dc3dd36ad90c27.asciidoc
new file mode 100644
index 0000000000..8a9983834c
--- /dev/null
+++ b/docs/examples/guide/ab1a989958c1d345a9dc3dd36ad90c27.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'POLYGON ((1000.0 1000.0, 1001.0 1000.0, 1001.0 1001.0, 1000.0 1001.0, 1000.0 1000.0), (1000.2 1000.2, 1000.8 1000.2, 1000.8 1000.8, 1000.2 1000.8, 1000.2 1000.2))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/ac73895ca1882cd1ac65b1facfbb5c63.asciidoc b/docs/examples/guide/ac73895ca1882cd1ac65b1facfbb5c63.asciidoc
index e2a8588ade..33b2a00167 100644
--- a/docs/examples/guide/ac73895ca1882cd1ac65b1facfbb5c63.asciidoc
+++ b/docs/examples/guide/ac73895ca1882cd1ac65b1facfbb5c63.asciidoc
@@ -5,7 +5,7 @@ response = client.delete_by_query(
body: {
query: {
match: {
- "user.id": 'elkbee'
+ 'user.id' => 'elkbee'
}
}
}
diff --git a/docs/examples/guide/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc b/docs/examples/guide/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc
index f3f73f378f..7b7834d1f7 100644
--- a/docs/examples/guide/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc
+++ b/docs/examples/guide/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc
@@ -4,7 +4,7 @@ response = client.cluster.put_settings(
flat_settings: true,
body: {
transient: {
- "indices.recovery.max_bytes_per_sec": '20mb'
+ 'indices.recovery.max_bytes_per_sec' => '20mb'
}
}
)
diff --git a/docs/examples/guide/ad2b8aed84c67cdc295917b47a12d3dc.asciidoc b/docs/examples/guide/ad2b8aed84c67cdc295917b47a12d3dc.asciidoc
new file mode 100644
index 0000000000..1e3b94b96d
--- /dev/null
+++ b/docs/examples/guide/ad2b8aed84c67cdc295917b47a12d3dc.asciidoc
@@ -0,0 +1,52 @@
+[source, ruby]
+----
+response = client.bulk(
+ index: 'my-image-index',
+ refresh: true,
+ body: [
+ {
+ index: {
+ _id: '1'
+ }
+ },
+ {
+ "image-vector": [
+ 1,
+ 5,
+ -20
+ ],
+ "file-type": 'jpg',
+ title: 'mountain lake'
+ },
+ {
+ index: {
+ _id: '2'
+ }
+ },
+ {
+ "image-vector": [
+ 42,
+ 8,
+ -15
+ ],
+ "file-type": 'png',
+ title: 'frozen lake'
+ },
+ {
+ index: {
+ _id: '3'
+ }
+ },
+ {
+ "image-vector": [
+ 15,
+ 11,
+ 23
+ ],
+ "file-type": 'jpg',
+ title: 'mountain lake lodge'
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/aee4734ee63dbbbd12a21ee886f7a829.asciidoc b/docs/examples/guide/aee4734ee63dbbbd12a21ee886f7a829.asciidoc
index add8e9257a..ea7e8a865b 100644
--- a/docs/examples/guide/aee4734ee63dbbbd12a21ee886f7a829.asciidoc
+++ b/docs/examples/guide/aee4734ee63dbbbd12a21ee886f7a829.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
sort: [
{
_geo_distance: {
- "pin.location": [
+ 'pin.location' => [
-70,
40
],
diff --git a/docs/examples/guide/afa11ebb493ebbfd77acbbe50d2ce6db.asciidoc b/docs/examples/guide/afa11ebb493ebbfd77acbbe50d2ce6db.asciidoc
new file mode 100644
index 0000000000..e90ad10592
--- /dev/null
+++ b/docs/examples/guide/afa11ebb493ebbfd77acbbe50d2ce6db.asciidoc
@@ -0,0 +1,42 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-data-stream',
+ body: {
+ size: 0,
+ aggregations: {
+ tsid: {
+ terms: {
+ field: '_tsid'
+ },
+ aggregations: {
+ over_time: {
+ date_histogram: {
+ field: '@timestamp',
+ fixed_interval: '1d'
+ },
+ aggregations: {
+ min: {
+ min: {
+ field: 'kubernetes.container.memory.usage.bytes'
+ }
+ },
+ max: {
+ max: {
+ field: 'kubernetes.container.memory.usage.bytes'
+ }
+ },
+ avg: {
+ avg: {
+ field: 'kubernetes.container.memory.usage.bytes'
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/afe30f159937b38d74c869570cfcd369.asciidoc b/docs/examples/guide/afe30f159937b38d74c869570cfcd369.asciidoc
new file mode 100644
index 0000000000..69b89face8
--- /dev/null
+++ b/docs/examples/guide/afe30f159937b38d74c869570cfcd369.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.indices.close(
+ index: 'index_1'
+)
+puts response
+
+response = client.snapshot.restore(
+ repository: 'my_repository',
+ snapshot: 'snapshot_2',
+ wait_for_completion: true,
+ body: {
+ indices: 'index_1'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b0d3f839237fabf8cdc2221734c668ad.asciidoc b/docs/examples/guide/b0d3f839237fabf8cdc2221734c668ad.asciidoc
new file mode 100644
index 0000000000..cea45cab9b
--- /dev/null
+++ b/docs/examples/guide/b0d3f839237fabf8cdc2221734c668ad.asciidoc
@@ -0,0 +1,47 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'items',
+ id: 1,
+ refresh: true,
+ body: {
+ name: 'chocolate',
+ production_date: '2018-02-01',
+ location: [
+ -71.34,
+ 41.12
+ ]
+ }
+)
+puts response
+
+response = client.index(
+ index: 'items',
+ id: 2,
+ refresh: true,
+ body: {
+ name: 'chocolate',
+ production_date: '2018-01-01',
+ location: [
+ -71.3,
+ 41.15
+ ]
+ }
+)
+puts response
+
+response = client.index(
+ index: 'items',
+ id: 3,
+ refresh: true,
+ body: {
+ name: 'chocolate',
+ production_date: '2017-12-01',
+ location: [
+ -71.3,
+ 41.12
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b10668cc742e666fe0eb6a53fd38a93e.asciidoc b/docs/examples/guide/b10668cc742e666fe0eb6a53fd38a93e.asciidoc
deleted file mode 100644
index 092bfb4a27..0000000000
--- a/docs/examples/guide/b10668cc742e666fe0eb6a53fd38a93e.asciidoc
+++ /dev/null
@@ -1,17 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- body: {
- query: {
- wildcard: {
- "user.id": {
- value: 'ki*y',
- boost: 1,
- rewrite: 'constant_score'
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/b195068563b1dc0f721f5f8c8d172312.asciidoc b/docs/examples/guide/b195068563b1dc0f721f5f8c8d172312.asciidoc
new file mode 100644
index 0000000000..70bfebbe9c
--- /dev/null
+++ b/docs/examples/guide/b195068563b1dc0f721f5f8c8d172312.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'MULTIPOINT (1002.0 2000.0, 1003.0 2000.0)'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b1f7cb4157b13368373383abd7d2b8cb.asciidoc b/docs/examples/guide/b1f7cb4157b13368373383abd7d2b8cb.asciidoc
index 1b11ed339e..43a4205f66 100644
--- a/docs/examples/guide/b1f7cb4157b13368373383abd7d2b8cb.asciidoc
+++ b/docs/examples/guide/b1f7cb4157b13368373383abd7d2b8cb.asciidoc
@@ -6,11 +6,11 @@ response = client.cluster.put_settings(
cluster: {
remote: {
cluster_two: {
- "transport.compress": false
+ 'transport.compress' => false
},
cluster_three: {
- "transport.compress": true,
- "transport.ping_schedule": '60s'
+ 'transport.compress' => true,
+ 'transport.ping_schedule' => '60s'
}
}
}
diff --git a/docs/examples/guide/b2652b1763a5fd31e95c983869b433bd.asciidoc b/docs/examples/guide/b2652b1763a5fd31e95c983869b433bd.asciidoc
index fb327d8967..884fb4084f 100644
--- a/docs/examples/guide/b2652b1763a5fd31e95c983869b433bd.asciidoc
+++ b/docs/examples/guide/b2652b1763a5fd31e95c983869b433bd.asciidoc
@@ -4,7 +4,7 @@ response = client.index(
index: 'metrics_index',
id: 1,
body: {
- "network.name": 'net-1',
+ 'network.name' => 'net-1',
latency_histo: {
values: [
0.1,
@@ -29,7 +29,7 @@ response = client.index(
index: 'metrics_index',
id: 2,
body: {
- "network.name": 'net-2',
+ 'network.name' => 'net-2',
latency_histo: {
values: [
0.1,
diff --git a/docs/examples/guide/b2e4f3257c0e0aa3311f7270034bbc42.asciidoc b/docs/examples/guide/b2e4f3257c0e0aa3311f7270034bbc42.asciidoc
index 18e11dd68a..f933bdc4b6 100644
--- a/docs/examples/guide/b2e4f3257c0e0aa3311f7270034bbc42.asciidoc
+++ b/docs/examples/guide/b2e4f3257c0e0aa3311f7270034bbc42.asciidoc
@@ -3,8 +3,8 @@
response = client.indices.put_settings(
index: 'my-index',
body: {
- "index.routing.allocation.require.data": nil,
- "index.routing.allocation.include._tier_preference": 'data_hot'
+ 'index.routing.allocation.require.data' => nil,
+ 'index.routing.allocation.include._tier_preference' => 'data_hot'
}
)
puts response
diff --git a/docs/examples/guide/b3fffd96fdb118cd059b5f1d67d928de.asciidoc b/docs/examples/guide/b3fffd96fdb118cd059b5f1d67d928de.asciidoc
new file mode 100644
index 0000000000..047e9266da
--- /dev/null
+++ b/docs/examples/guide/b3fffd96fdb118cd059b5f1d67d928de.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'MultiPoint',
+ coordinates: [
+ [
+ 102,
+ 2
+ ],
+ [
+ 103,
+ 2
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b45a8c6fc746e9c90fd181e69a605fad.asciidoc b/docs/examples/guide/b45a8c6fc746e9c90fd181e69a605fad.asciidoc
new file mode 100644
index 0000000000..404b498679
--- /dev/null
+++ b/docs/examples/guide/b45a8c6fc746e9c90fd181e69a605fad.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.inference.inference(
+ task_type: 'completion',
+ inference_id: 'openai_chat_completions',
+ body: {
+ input: 'What is Elastic?'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b468d0124dc485385a34504d5b7af82a.asciidoc b/docs/examples/guide/b468d0124dc485385a34504d5b7af82a.asciidoc
new file mode 100644
index 0000000000..ba765740ff
--- /dev/null
+++ b/docs/examples/guide/b468d0124dc485385a34504d5b7af82a.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.reindex(
+ wait_for_completion: false,
+ body: {
+ source: {
+ index: 'test-data',
+ size: 50
+ },
+ dest: {
+ index: 'hugging-face-embeddings',
+ pipeline: 'hugging_face_embeddings'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b4693f2aa9fa65db04ab2499355c54fc.asciidoc b/docs/examples/guide/b4693f2aa9fa65db04ab2499355c54fc.asciidoc
new file mode 100644
index 0000000000..0b81c86c08
--- /dev/null
+++ b/docs/examples/guide/b4693f2aa9fa65db04ab2499355c54fc.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'cohere-embeddings',
+ body: {
+ knn: {
+ field: 'content_embedding',
+ query_vector_builder: {
+ text_embedding: {
+ model_id: 'cohere_embeddings',
+ model_text: 'Muscles in human body'
+ }
+ },
+ k: 10,
+ num_candidates: 100
+ },
+ _source: [
+ 'id',
+ 'content'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b4d1fc887e40885cdf6ac2d01487cb76.asciidoc b/docs/examples/guide/b4d1fc887e40885cdf6ac2d01487cb76.asciidoc
index d707ea61c8..dcf7020036 100644
--- a/docs/examples/guide/b4d1fc887e40885cdf6ac2d01487cb76.asciidoc
+++ b/docs/examples/guide/b4d1fc887e40885cdf6ac2d01487cb76.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
span_multi: {
match: {
prefix: {
- "user.id": {
+ 'user.id' => {
value: 'ki',
boost: 1.08
}
diff --git a/docs/examples/guide/b504119238b44cddd3b5944da20a498d.asciidoc b/docs/examples/guide/b504119238b44cddd3b5944da20a498d.asciidoc
new file mode 100644
index 0000000000..f85e58adbc
--- /dev/null
+++ b/docs/examples/guide/b504119238b44cddd3b5944da20a498d.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'POLYGON ((1000.0 -1001.0, 1001.0 -1001.0, 1001.0 -1000.0, 1000.0 -1000.0, 1000.0 -1001.0))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b52951b78cd5fb2f9353d1c7e6d37070.asciidoc b/docs/examples/guide/b52951b78cd5fb2f9353d1c7e6d37070.asciidoc
new file mode 100644
index 0000000000..2261272f20
--- /dev/null
+++ b/docs/examples/guide/b52951b78cd5fb2f9353d1c7e6d37070.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.search(
+ body: {
+ query: {
+ wildcard: {
+ 'user.id' => {
+ value: 'ki*y',
+ boost: 1,
+ rewrite: 'constant_score_blended'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/b557f114e21dbc6f531d4e7621a08e8f.asciidoc b/docs/examples/guide/b557f114e21dbc6f531d4e7621a08e8f.asciidoc
index cfea3caa37..39e3185163 100644
--- a/docs/examples/guide/b557f114e21dbc6f531d4e7621a08e8f.asciidoc
+++ b/docs/examples/guide/b557f114e21dbc6f531d4e7621a08e8f.asciidoc
@@ -44,7 +44,7 @@ response = client.search(
body: {
query: {
match: {
- "meta.other.foo": 'one'
+ 'meta.other.foo' => 'one'
}
}
}
diff --git a/docs/examples/guide/b583bf8d3a2f49d633aa2cfed5606418.asciidoc b/docs/examples/guide/b583bf8d3a2f49d633aa2cfed5606418.asciidoc
index c28dcdd1d6..295a10de52 100644
--- a/docs/examples/guide/b583bf8d3a2f49d633aa2cfed5606418.asciidoc
+++ b/docs/examples/guide/b583bf8d3a2f49d633aa2cfed5606418.asciidoc
@@ -12,7 +12,7 @@ response = client.cluster.put_component_template(
"alias2": {
filter: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
routing: 'shard-1'
diff --git a/docs/examples/guide/b58b17975bbce307b2ccce5051a449e8.asciidoc b/docs/examples/guide/b58b17975bbce307b2ccce5051a449e8.asciidoc
index 7a008b052c..bda784836c 100644
--- a/docs/examples/guide/b58b17975bbce307b2ccce5051a449e8.asciidoc
+++ b/docs/examples/guide/b58b17975bbce307b2ccce5051a449e8.asciidoc
@@ -7,7 +7,7 @@ response = client.search(
body: {
query: {
range: {
- "http.response.bytes": {
+ 'http.response.bytes' => {
lt: 2_000_000
}
}
diff --git a/docs/examples/guide/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc b/docs/examples/guide/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc
new file mode 100644
index 0000000000..3fecc83c71
--- /dev/null
+++ b/docs/examples/guide/b62eaa20c4e0e48134a6d1d1b3c30b26.asciidoc
@@ -0,0 +1,191 @@
+[source, ruby]
+----
+response = client.bulk(
+ refresh: true,
+ body: [
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:36,256][INFO ][o.a.l.u.VectorUtilPanamaProvider] [laptop] Java vector incubator API enabled; uses preferredBitSize=128'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,038][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-url]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,042][INFO ][o.e.p.PluginsService ] [laptop] loaded module [rest-root]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-core]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-redact]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,043][INFO ][o.e.p.PluginsService ] [laptop] loaded module [ingest-user-agent]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-monitoring]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [repository-s3]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-analytics]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-ent-search]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-autoscaling]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,044][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-painless]]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [lang-expression]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:41,059][INFO ][o.e.p.PluginsService ] [laptop] loaded module [x-pack-eql]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:43,291][INFO ][o.e.e.NodeEnvironment ] [laptop] heap size [16gb], compressed ordinary object pointers [true]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:46,098][INFO ][o.e.x.s.Security ] [laptop] Security is enabled'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:47,227][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] Profiling is enabled'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:47,259][INFO ][o.e.x.p.ProfilingPlugin ] [laptop] profiling index templates will not be installed or reinstalled'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:47,755][INFO ][o.e.i.r.RecoverySettings ] [laptop] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:47,787][INFO ][o.e.d.DiscoveryModule ] [laptop] using discovery type [multi-node] and seed hosts providers [settings]'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:49,188][INFO ][o.e.n.Node ] [laptop] initialized'
+ },
+ {
+ index: {
+ _index: 'test-logs'
+ }
+ },
+ {
+ message: '[2024-03-05T10:52:49,199][INFO ][o.e.n.Node ] [laptop] starting ...'
+ }
+ ]
+)
+puts response
+
+response = client.text_structure.find_field_structure(
+ index: 'test-logs',
+ field: 'message'
+)
+puts response
+----
diff --git a/docs/examples/guide/b638e11d6a8a084290f8934d224abd52.asciidoc b/docs/examples/guide/b638e11d6a8a084290f8934d224abd52.asciidoc
index 87c0e6cb06..eba6cdec04 100644
--- a/docs/examples/guide/b638e11d6a8a084290f8934d224abd52.asciidoc
+++ b/docs/examples/guide/b638e11d6a8a084290f8934d224abd52.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.max_shards_per_node.frozen": nil
+ 'cluster.max_shards_per_node.frozen' => nil
}
}
)
diff --git a/docs/examples/guide/b67fa8c560dd10a8e6f226048cd21562.asciidoc b/docs/examples/guide/b67fa8c560dd10a8e6f226048cd21562.asciidoc
index ee517ec29d..abfb71a3f5 100644
--- a/docs/examples/guide/b67fa8c560dd10a8e6f226048cd21562.asciidoc
+++ b/docs/examples/guide/b67fa8c560dd10a8e6f226048cd21562.asciidoc
@@ -7,12 +7,12 @@ response = client.render_search_template(
clauses: [
{
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
{
term: {
- "url.domain": 'example.com'
+ 'url.domain' => 'example.com'
}
}
]
diff --git a/docs/examples/guide/b6a6aa9ba20e9a019371ae268488833f.asciidoc b/docs/examples/guide/b6a6aa9ba20e9a019371ae268488833f.asciidoc
new file mode 100644
index 0000000000..a4f24c10ad
--- /dev/null
+++ b/docs/examples/guide/b6a6aa9ba20e9a019371ae268488833f.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.cluster.get_settings(
+ filter_path: 'persistent.cluster.remote'
+)
+puts response
+----
diff --git a/docs/examples/guide/b724f547c5d67e95bbc0a9920e47033c.asciidoc b/docs/examples/guide/b724f547c5d67e95bbc0a9920e47033c.asciidoc
index 716647e93a..aebebd604f 100644
--- a/docs/examples/guide/b724f547c5d67e95bbc0a9920e47033c.asciidoc
+++ b/docs/examples/guide/b724f547c5d67e95bbc0a9920e47033c.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
term: {
- "file_path.tree": '/User/alice/photos/2017/05/16'
+ 'file_path.tree' => '/User/alice/photos/2017/05/16'
}
}
}
diff --git a/docs/examples/guide/b7a9f60b3646efe3834ca8381f8aa560.asciidoc b/docs/examples/guide/b7a9f60b3646efe3834ca8381f8aa560.asciidoc
index 875fedeb33..3fdf15b9d7 100644
--- a/docs/examples/guide/b7a9f60b3646efe3834ca8381f8aa560.asciidoc
+++ b/docs/examples/guide/b7a9f60b3646efe3834ca8381f8aa560.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "logger.org.elasticsearch.discovery": nil
+ 'logger.org.elasticsearch.discovery' => nil
}
}
)
diff --git a/docs/examples/guide/b8ff63c3d7561d27d035ef204097d631.asciidoc b/docs/examples/guide/b8ff63c3d7561d27d035ef204097d631.asciidoc
deleted file mode 100644
index 8d98383046..0000000000
--- a/docs/examples/guide/b8ff63c3d7561d27d035ef204097d631.asciidoc
+++ /dev/null
@@ -1,24 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'test_index',
- body: {
- settings: {
- index: {
- analysis: {
- filter: {
- synonym: {
- type: 'synonym_graph',
- synonyms: [
- 'lol, laughing out loud',
- 'universe, cosmos'
- ]
- }
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc b/docs/examples/guide/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc
new file mode 100644
index 0000000000..1847170105
--- /dev/null
+++ b/docs/examples/guide/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'books'
+)
+puts response
+----
diff --git a/docs/examples/guide/bcdfaa4487747249699a86a0dcd22f5e.asciidoc b/docs/examples/guide/bcdfaa4487747249699a86a0dcd22f5e.asciidoc
new file mode 100644
index 0000000000..764a69f690
--- /dev/null
+++ b/docs/examples/guide/bcdfaa4487747249699a86a0dcd22f5e.asciidoc
@@ -0,0 +1,35 @@
+[source, ruby]
+----
+response = client.simulate.ingest(
+ body: {
+ docs: [
+ {
+ _index: 'my-index',
+ _id: '123',
+ _source: {
+ foo: 'bar'
+ }
+ },
+ {
+ _index: 'my-index',
+ _id: '456',
+ _source: {
+ foo: 'rab'
+ }
+ }
+ ],
+ pipeline_substitutions: {
+ "my-pipeline": {
+ processors: [
+ {
+ uppercase: {
+ field: 'foo'
+ }
+ }
+ ]
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/bd298b11933605c641626750c981d70b.asciidoc b/docs/examples/guide/bd298b11933605c641626750c981d70b.asciidoc
index 183f842042..4ed3cdee10 100644
--- a/docs/examples/guide/bd298b11933605c641626750c981d70b.asciidoc
+++ b/docs/examples/guide/bd298b11933605c641626750c981d70b.asciidoc
@@ -5,7 +5,7 @@ response = client.cluster.put_component_template(
body: {
template: {
settings: {
- "index.number_of_shards": 2
+ 'index.number_of_shards' => 2
}
}
}
@@ -17,7 +17,7 @@ response = client.cluster.put_component_template(
body: {
template: {
settings: {
- "index.number_of_replicas": 0
+ 'index.number_of_replicas' => 0
},
mappings: {
properties: {
@@ -38,7 +38,7 @@ response = client.indices.simulate_template(
],
template: {
settings: {
- "index.number_of_shards": 3
+ 'index.number_of_shards' => 3
}
},
composed_of: [
diff --git a/docs/examples/guide/bd2a387e8c21bf01a1039e81d7602921.asciidoc b/docs/examples/guide/bd2a387e8c21bf01a1039e81d7602921.asciidoc
new file mode 100644
index 0000000000..473131f62d
--- /dev/null
+++ b/docs/examples/guide/bd2a387e8c21bf01a1039e81d7602921.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.put_script(
+ id: 'my-search-template',
+ body: {
+ script: {
+ lang: 'mustache',
+ source: {
+ query: {
+ multi_match: {
+ query: '{{query_string}}',
+ fields: '[{{#text_fields}}{{user_name}},{{/text_fields}}]'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/bd7330af2609bdd8aa10958f5e640b93.asciidoc b/docs/examples/guide/bd7330af2609bdd8aa10958f5e640b93.asciidoc
index 13b52877d5..558b714bc6 100644
--- a/docs/examples/guide/bd7330af2609bdd8aa10958f5e640b93.asciidoc
+++ b/docs/examples/guide/bd7330af2609bdd8aa10958f5e640b93.asciidoc
@@ -7,7 +7,7 @@ response = client.index(
body: {
query: {
match: {
- "my_field.suffix": 'xyz'
+ 'my_field.suffix' => 'xyz'
}
}
}
diff --git a/docs/examples/guide/bd93b6f99ed785cf7520370a4cf6b834.asciidoc b/docs/examples/guide/bd93b6f99ed785cf7520370a4cf6b834.asciidoc
deleted file mode 100644
index fd38aef22a..0000000000
--- a/docs/examples/guide/bd93b6f99ed785cf7520370a4cf6b834.asciidoc
+++ /dev/null
@@ -1,19 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- index: 'cluster_one:my-index-000001',
- body: {
- query: {
- match: {
- "user.id": 'kimchy'
- }
- },
- _source: [
- 'user.id',
- 'message',
- 'http.response.status_code'
- ]
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/bdfb86cdfffb9d2ee6e3d399f00a57b0.asciidoc b/docs/examples/guide/bdfb86cdfffb9d2ee6e3d399f00a57b0.asciidoc
new file mode 100644
index 0000000000..7f1807e9dc
--- /dev/null
+++ b/docs/examples/guide/bdfb86cdfffb9d2ee6e3d399f00a57b0.asciidoc
@@ -0,0 +1,38 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'test*',
+ filter_path: 'aggregations',
+ body: {
+ aggregations: {
+ ip: {
+ terms: {
+ field: 'ip'
+ },
+ aggregations: {
+ tm: {
+ top_metrics: {
+ metrics: {
+ field: 'm'
+ },
+ sort: {
+ s: 'desc'
+ },
+ size: 1
+ }
+ },
+ having_tm: {
+ bucket_selector: {
+ buckets_path: {
+ top_m: 'tm[m]'
+ },
+ script: 'params.top_m < 1000'
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/be30ea12f605fd61acba689b68e00bbe.asciidoc b/docs/examples/guide/be30ea12f605fd61acba689b68e00bbe.asciidoc
new file mode 100644
index 0000000000..4ceb3acb11
--- /dev/null
+++ b/docs/examples/guide/be30ea12f605fd61acba689b68e00bbe.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.ingest.put_pipeline(
+ id: 'hugging_face_embeddings',
+ body: {
+ processors: [
+ {
+ inference: {
+ model_id: 'hugging_face_embeddings',
+ input_output: {
+ input_field: 'content',
+ output_field: 'content_embedding'
+ }
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/beba2a9795c8a13653e1edf64eec4357.asciidoc b/docs/examples/guide/beba2a9795c8a13653e1edf64eec4357.asciidoc
index 92894faa71..66ed47d74b 100644
--- a/docs/examples/guide/beba2a9795c8a13653e1edf64eec4357.asciidoc
+++ b/docs/examples/guide/beba2a9795c8a13653e1edf64eec4357.asciidoc
@@ -3,8 +3,8 @@
response = client.indices.put_settings(
index: 'test',
body: {
- "index.routing.allocation.require.size": 'big',
- "index.routing.allocation.require.rack": 'rack1'
+ 'index.routing.allocation.require.size' => 'big',
+ 'index.routing.allocation.require.rack' => 'rack1'
}
)
puts response
diff --git a/docs/examples/guide/bf17440ac178d2ef5f5be643d033920b.asciidoc b/docs/examples/guide/bf17440ac178d2ef5f5be643d033920b.asciidoc
new file mode 100644
index 0000000000..fce14b1e5c
--- /dev/null
+++ b/docs/examples/guide/bf17440ac178d2ef5f5be643d033920b.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.reindex(
+ wait_for_completion: false,
+ body: {
+ source: {
+ index: 'test-data',
+ size: 50
+ },
+ dest: {
+ index: 'my-index',
+ pipeline: 'elser-v2-test'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c00c9412609832ebceb9e786dd9542df.asciidoc b/docs/examples/guide/c00c9412609832ebceb9e786dd9542df.asciidoc
new file mode 100644
index 0000000000..9de66a6634
--- /dev/null
+++ b/docs/examples/guide/c00c9412609832ebceb9e786dd9542df.asciidoc
@@ -0,0 +1,11 @@
+[source, ruby]
+----
+response = client.connector.update_name(
+ connector_id: 'my-connector',
+ body: {
+ name: 'Custom connector',
+ description: 'This is my customized connector'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c03ce952de42eae4b522cedc9fd3d14a.asciidoc b/docs/examples/guide/c03ce952de42eae4b522cedc9fd3d14a.asciidoc
new file mode 100644
index 0000000000..e01b21843c
--- /dev/null
+++ b/docs/examples/guide/c03ce952de42eae4b522cedc9fd3d14a.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.8, 100.2 0.2))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc b/docs/examples/guide/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc
index 17f1c2f485..f5256a99aa 100644
--- a/docs/examples/guide/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc
+++ b/docs/examples/guide/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
term: {
- "user.id": {
+ 'user.id' => {
value: 'kimchy',
boost: 1
}
diff --git a/docs/examples/guide/c12d6e962f083c728f9397932f05202e.asciidoc b/docs/examples/guide/c12d6e962f083c728f9397932f05202e.asciidoc
new file mode 100644
index 0000000000..af049b4a60
--- /dev/null
+++ b/docs/examples/guide/c12d6e962f083c728f9397932f05202e.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.sync_job_list(
+ connector_id: 'connector-1'
+)
+puts response
+----
diff --git a/docs/examples/guide/c147de68fd6da032ad4a3c1bf626f5d6.asciidoc b/docs/examples/guide/c147de68fd6da032ad4a3c1bf626f5d6.asciidoc
index d546052bea..bec37a16f4 100644
--- a/docs/examples/guide/c147de68fd6da032ad4a3c1bf626f5d6.asciidoc
+++ b/docs/examples/guide/c147de68fd6da032ad4a3c1bf626f5d6.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
diff --git a/docs/examples/guide/c21eb4bc30087188241cbba6b6b89999.asciidoc b/docs/examples/guide/c21eb4bc30087188241cbba6b6b89999.asciidoc
new file mode 100644
index 0000000000..8d2f8d4065
--- /dev/null
+++ b/docs/examples/guide/c21eb4bc30087188241cbba6b6b89999.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.connector.update_service_type(
+ connector_id: 'my-connector',
+ body: {
+ service_type: 'sharepoint_online'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c23e32775340d7bc6f46820313014d8a.asciidoc b/docs/examples/guide/c23e32775340d7bc6f46820313014d8a.asciidoc
new file mode 100644
index 0000000000..e805168775
--- /dev/null
+++ b/docs/examples/guide/c23e32775340d7bc6f46820313014d8a.asciidoc
@@ -0,0 +1,14 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'my_test_scores_2',
+ pipeline: 'my_test_scores_pipeline',
+ body: {
+ student: 'kimchy',
+ grad_year: '2099',
+ math_score: 1200,
+ verbal_score: 800
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c5cc19e48549fbc5327a9d46874bbeee.asciidoc b/docs/examples/guide/c5cc19e48549fbc5327a9d46874bbeee.asciidoc
new file mode 100644
index 0000000000..fa4724efbb
--- /dev/null
+++ b/docs/examples/guide/c5cc19e48549fbc5327a9d46874bbeee.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'quantized-image-index',
+ body: {
+ knn: {
+ field: 'image-vector',
+ query_vector: [
+ 0.1,
+ -2
+ ],
+ k: 10,
+ num_candidates: 100
+ },
+ fields: [
+ 'title'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c639036b87d02fb864e27c4ca29ef833.asciidoc b/docs/examples/guide/c639036b87d02fb864e27c4ca29ef833.asciidoc
index 70085a418a..c219c225be 100644
--- a/docs/examples/guide/c639036b87d02fb864e27c4ca29ef833.asciidoc
+++ b/docs/examples/guide/c639036b87d02fb864e27c4ca29ef833.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
}
},
runtime_mappings: {
- "tags.hash": {
+ 'tags.hash' => {
type: 'long',
script: "emit(doc['tags'].hashCode())"
}
diff --git a/docs/examples/guide/c654b09be981be12fc7be0ba33f8652b.asciidoc b/docs/examples/guide/c654b09be981be12fc7be0ba33f8652b.asciidoc
new file mode 100644
index 0000000000..2dfe3a115a
--- /dev/null
+++ b/docs/examples/guide/c654b09be981be12fc7be0ba33f8652b.asciidoc
@@ -0,0 +1,68 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'multilinestring',
+ coordinates: [
+ [
+ [
+ 1002,
+ 200
+ ],
+ [
+ 1003,
+ 200
+ ],
+ [
+ 1003,
+ 300
+ ],
+ [
+ 1002,
+ 300
+ ]
+ ],
+ [
+ [
+ 1000,
+ 100
+ ],
+ [
+ 1001,
+ 100
+ ],
+ [
+ 1001,
+ 100
+ ],
+ [
+ 1000,
+ 100
+ ]
+ ],
+ [
+ [
+ 1000.2,
+ 100.2
+ ],
+ [
+ 1000.8,
+ 100.2
+ ],
+ [
+ 1000.8,
+ 100.8
+ ],
+ [
+ 1000.2,
+ 100.8
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c6b365c7da97d7e50f36820a7d36f548.asciidoc b/docs/examples/guide/c6b365c7da97d7e50f36820a7d36f548.asciidoc
index cef43b446e..5e88cc78b4 100644
--- a/docs/examples/guide/c6b365c7da97d7e50f36820a7d36f548.asciidoc
+++ b/docs/examples/guide/c6b365c7da97d7e50f36820a7d36f548.asciidoc
@@ -3,7 +3,7 @@
response = client.indices.put_settings(
index: 'my_index,my_other_index',
body: {
- "index.number_of_replicas": 1
+ 'index.number_of_replicas' => 1
}
)
puts response
diff --git a/docs/examples/guide/c6b8713bd49661d69d6b868f5b991d17.asciidoc b/docs/examples/guide/c6b8713bd49661d69d6b868f5b991d17.asciidoc
new file mode 100644
index 0000000000..251b5f7aef
--- /dev/null
+++ b/docs/examples/guide/c6b8713bd49661d69d6b868f5b991d17.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'job-candidates',
+ id: 1,
+ refresh: true,
+ body: {
+ name: 'Jane Smith',
+ programming_languages: [
+ 'c++',
+ 'java'
+ ],
+ required_matches: 2
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c6d5e3b6ff9c665ec5344a4bfa7add80.asciidoc b/docs/examples/guide/c6d5e3b6ff9c665ec5344a4bfa7add80.asciidoc
index dca0ac8dda..7ae0b33dbd 100644
--- a/docs/examples/guide/c6d5e3b6ff9c665ec5344a4bfa7add80.asciidoc
+++ b/docs/examples/guide/c6d5e3b6ff9c665ec5344a4bfa7add80.asciidoc
@@ -3,8 +3,8 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "transport.tracer.include": '*',
- "transport.tracer.exclude": 'internal:coordination/fault_detection/*'
+ 'transport.tracer.include' => '*',
+ 'transport.tracer.exclude' => 'internal:coordination/fault_detection/*'
}
}
)
diff --git a/docs/examples/guide/c8210f23c10d0642f24c1e43faa4deda.asciidoc b/docs/examples/guide/c8210f23c10d0642f24c1e43faa4deda.asciidoc
index 92183050c9..b2bd798c45 100644
--- a/docs/examples/guide/c8210f23c10d0642f24c1e43faa4deda.asciidoc
+++ b/docs/examples/guide/c8210f23c10d0642f24c1e43faa4deda.asciidoc
@@ -29,7 +29,7 @@ response = client.cluster.put_component_template(
body: {
template: {
settings: {
- "index.lifecycle.name": 'my-lifecycle-policy'
+ 'index.lifecycle.name' => 'my-lifecycle-policy'
}
},
_meta: {
diff --git a/docs/examples/guide/c8e2109b19d50467ab83a40006462e9f.asciidoc b/docs/examples/guide/c8e2109b19d50467ab83a40006462e9f.asciidoc
new file mode 100644
index 0000000000..bca712d4d5
--- /dev/null
+++ b/docs/examples/guide/c8e2109b19d50467ab83a40006462e9f.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.enrich.execute_policy(
+ name: 'my-policy',
+ wait_for_completion: false
+)
+puts response
+----
diff --git a/docs/examples/guide/c93e63f3fb62f588d62ffbbefe73212e.asciidoc b/docs/examples/guide/c93e63f3fb62f588d62ffbbefe73212e.asciidoc
deleted file mode 100644
index 121073c7ba..0000000000
--- a/docs/examples/guide/c93e63f3fb62f588d62ffbbefe73212e.asciidoc
+++ /dev/null
@@ -1,24 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'image-index',
- body: {
- mappings: {
- properties: {
- "image-vector": {
- type: 'dense_vector',
- dims: 3,
- index: true,
- similarity: 'l2_norm',
- index_options: {
- type: 'hnsw',
- m: 32,
- ef_construction: 100
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/c9a6ab0a56bb0177f158277185f68302.asciidoc b/docs/examples/guide/c9a6ab0a56bb0177f158277185f68302.asciidoc
new file mode 100644
index 0000000000..b740ab6108
--- /dev/null
+++ b/docs/examples/guide/c9a6ab0a56bb0177f158277185f68302.asciidoc
@@ -0,0 +1,57 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index-000001',
+ body: {
+ mappings: {
+ properties: {
+ metrics: {
+ type: 'object',
+ subobjects: false,
+ properties: {
+ time: {
+ type: 'long'
+ },
+ 'time.min' => {
+ type: 'long'
+ },
+ 'time.max' => {
+ type: 'long'
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'my-index-000001',
+ id: 'metric_1',
+ body: {
+ 'metrics.time' => 100,
+ 'metrics.time.min' => 10,
+ 'metrics.time.max' => 900
+ }
+)
+puts response
+
+response = client.index(
+ index: 'my-index-000001',
+ id: 'metric_2',
+ body: {
+ metrics: {
+ time: 100,
+ 'time.min' => 10,
+ 'time.max' => 900
+ }
+ }
+)
+puts response
+
+response = client.indices.get_mapping(
+ index: 'my-index-000001'
+)
+puts response
+----
diff --git a/docs/examples/guide/c9afa715021f2e6450e72ac73271960c.asciidoc b/docs/examples/guide/c9afa715021f2e6450e72ac73271960c.asciidoc
new file mode 100644
index 0000000000..28bfc03130
--- /dev/null
+++ b/docs/examples/guide/c9afa715021f2e6450e72ac73271960c.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'parent_example',
+ id: 1,
+ body: {
+ join: {
+ name: 'question'
+ },
+ body: 'I have Windows 2003 server and i bought a new Windows 2008 server...',
+ title: 'Whats the best way to file transfer my site from server to a newer one?',
+ tags: [
+ 'windows-server-2003',
+ 'windows-server-2008',
+ 'file-transfer'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/c9d9a1d751f20f6197c825cb4378fe9f.asciidoc b/docs/examples/guide/c9d9a1d751f20f6197c825cb4378fe9f.asciidoc
index c3d3086e7e..9ce4d41e18 100644
--- a/docs/examples/guide/c9d9a1d751f20f6197c825cb4378fe9f.asciidoc
+++ b/docs/examples/guide/c9d9a1d751f20f6197c825cb4378fe9f.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
terms: {
- "user.id": [
+ 'user.id' => [
'kimchy',
'elkbee'
],
diff --git a/docs/examples/guide/ca06db2aa4747910278f96315f7be94b.asciidoc b/docs/examples/guide/ca06db2aa4747910278f96315f7be94b.asciidoc
index 57dbb4e978..2af4363f12 100644
--- a/docs/examples/guide/ca06db2aa4747910278f96315f7be94b.asciidoc
+++ b/docs/examples/guide/ca06db2aa4747910278f96315f7be94b.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
},
filter: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
top: 40.73,
left: -74.1,
bottom: 40.01,
diff --git a/docs/examples/guide/ca08e511e5907d258081b10a1a9f0072.asciidoc b/docs/examples/guide/ca08e511e5907d258081b10a1a9f0072.asciidoc
index 75e97033a2..f03c7172ea 100644
--- a/docs/examples/guide/ca08e511e5907d258081b10a1a9f0072.asciidoc
+++ b/docs/examples/guide/ca08e511e5907d258081b10a1a9f0072.asciidoc
@@ -17,10 +17,10 @@ response = client.indices.put_index_template(
}
},
settings: {
- "sort.field": [
+ 'sort.field' => [
'@timestamp'
],
- "sort.order": [
+ 'sort.order' => [
'desc'
]
}
diff --git a/docs/examples/guide/cafed0e2c2b1d1574eb4a5ecd514a97a.asciidoc b/docs/examples/guide/cafed0e2c2b1d1574eb4a5ecd514a97a.asciidoc
index b1e32fee6c..0558bde6e6 100644
--- a/docs/examples/guide/cafed0e2c2b1d1574eb4a5ecd514a97a.asciidoc
+++ b/docs/examples/guide/cafed0e2c2b1d1574eb4a5ecd514a97a.asciidoc
@@ -5,7 +5,7 @@ response = client.indices.split(
target: 'split-my-index-000001',
body: {
settings: {
- "index.number_of_shards": 2
+ 'index.number_of_shards' => 2
}
}
)
diff --git a/docs/examples/guide/cb0c3223fd45148497df73adfba2e9ce.asciidoc b/docs/examples/guide/cb0c3223fd45148497df73adfba2e9ce.asciidoc
index 035249c0ae..93e5d03d8b 100644
--- a/docs/examples/guide/cb0c3223fd45148497df73adfba2e9ce.asciidoc
+++ b/docs/examples/guide/cb0c3223fd45148497df73adfba2e9ce.asciidoc
@@ -6,7 +6,7 @@ response = client.reindex(
index: 'my-index-000001',
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
},
diff --git a/docs/examples/guide/cbc2b5595890f87165aab1a741b1d22c.asciidoc b/docs/examples/guide/cbc2b5595890f87165aab1a741b1d22c.asciidoc
new file mode 100644
index 0000000000..e318873277
--- /dev/null
+++ b/docs/examples/guide/cbc2b5595890f87165aab1a741b1d22c.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.ingest.put_pipeline(
+ id: 'my-timestamp-pipeline',
+ body: {
+ description: 'Shifts the @timestamp to the last 15 minutes',
+ processors: [
+ {
+ set: {
+ field: 'ingest_time',
+ value: '{{_ingest.timestamp}}'
+ }
+ },
+ {
+ script: {
+ lang: 'painless',
+ source: "\n def delta = ChronoUnit.SECONDS.between(\n ZonedDateTime.parse(\"2022-06-21T15:49:00Z\"),\n ZonedDateTime.parse(ctx[\"ingest_time\"])\n );\n ctx[\"@timestamp\"] = ZonedDateTime.parse(ctx[\"@timestamp\"]).plus(delta,ChronoUnit.SECONDS).toString();\n "
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/cc28a3dafcd5056f2a3ec07f6fda5091.asciidoc b/docs/examples/guide/cc28a3dafcd5056f2a3ec07f6fda5091.asciidoc
new file mode 100644
index 0000000000..430772d14d
--- /dev/null
+++ b/docs/examples/guide/cc28a3dafcd5056f2a3ec07f6fda5091.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index-000001',
+ body: {
+ runtime_mappings: {
+ day_of_week: {
+ type: 'keyword',
+ script: {
+ source: "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
+ }
+ }
+ },
+ aggregations: {
+ day_of_week: {
+ terms: {
+ field: 'day_of_week'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/cc7f1c74ede6810e2c9db19256d6b653.asciidoc b/docs/examples/guide/cc7f1c74ede6810e2c9db19256d6b653.asciidoc
index 18a0c7c26b..f34d61a238 100644
--- a/docs/examples/guide/cc7f1c74ede6810e2c9db19256d6b653.asciidoc
+++ b/docs/examples/guide/cc7f1c74ede6810e2c9db19256d6b653.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
match: {
- "http.response": '304'
+ 'http.response' => '304'
}
},
fields: [
diff --git a/docs/examples/guide/cd16538654e0f834ff19fe6cf329c398.asciidoc b/docs/examples/guide/cd16538654e0f834ff19fe6cf329c398.asciidoc
new file mode 100644
index 0000000000..c385c2be7d
--- /dev/null
+++ b/docs/examples/guide/cd16538654e0f834ff19fe6cf329c398.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'hugging-face-embeddings',
+ body: {
+ mappings: {
+ properties: {
+ content_embedding: {
+ type: 'dense_vector',
+ dims: 768,
+ element_type: 'float'
+ },
+ content: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc b/docs/examples/guide/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc
new file mode 100644
index 0000000000..6e9f003a13
--- /dev/null
+++ b/docs/examples/guide/cdce7bc083dfb36e6f1d465a5c9d5049.asciidoc
@@ -0,0 +1,5 @@
+[source, ruby]
+----
+response = client.connector.sync_job_list
+puts response
+----
diff --git a/docs/examples/guide/cdd7127681254f4d614cc075f9e6fbcf.asciidoc b/docs/examples/guide/cdd7127681254f4d614cc075f9e6fbcf.asciidoc
index 31dec0f24d..bda041005b 100644
--- a/docs/examples/guide/cdd7127681254f4d614cc075f9e6fbcf.asciidoc
+++ b/docs/examples/guide/cdd7127681254f4d614cc075f9e6fbcf.asciidoc
@@ -5,7 +5,7 @@ response = client.delete_by_query(
body: {
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
max_docs: 1
diff --git a/docs/examples/guide/cde19d110a58317610033ea3dcb0eb80.asciidoc b/docs/examples/guide/cde19d110a58317610033ea3dcb0eb80.asciidoc
new file mode 100644
index 0000000000..876bde8b82
--- /dev/null
+++ b/docs/examples/guide/cde19d110a58317610033ea3dcb0eb80.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.render_search_template(
+ body: {
+ source: "\n {\n \"query\": {\n \"match\": {\n {{#query_message}}\n {{#query_string}}\n \"message\": \"Hello {{#first_name_section}}{{first_name}}{{/first_name_section}} {{#last_name_section}}{{last_name}}{{/last_name_section}}\"\n {{/query_string}}\n {{/query_message}}\n }\n }\n }\n ",
+ params: {
+ query_message: {
+ query_string: {
+ first_name_section: {
+ first_name: 'John'
+ },
+ last_name_section: {
+ last_name: 'kimchy'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/cdfd4fef983c1c0fe8d7417f67d01eae.asciidoc b/docs/examples/guide/cdfd4fef983c1c0fe8d7417f67d01eae.asciidoc
index e40927b7a6..0d75f56638 100644
--- a/docs/examples/guide/cdfd4fef983c1c0fe8d7417f67d01eae.asciidoc
+++ b/docs/examples/guide/cdfd4fef983c1c0fe8d7417f67d01eae.asciidoc
@@ -2,7 +2,7 @@
----
response = client.indices.put_settings(
body: {
- "index.number_of_replicas": 1
+ 'index.number_of_replicas' => 1
}
)
puts response
diff --git a/docs/examples/guide/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc b/docs/examples/guide/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc
new file mode 100644
index 0000000000..82556abd34
--- /dev/null
+++ b/docs/examples/guide/ce13afc0c976c5e1f424b58e0c97fd64.asciidoc
@@ -0,0 +1,14 @@
+[source, ruby]
+----
+response = client.connector.put(
+ connector_id: 'my-connector',
+ body: {
+ index_name: 'search-google-drive',
+ name: 'My Connector',
+ description: 'My Connector to sync data to Elastic index from Google Drive',
+ service_type: 'google_drive',
+ language: 'english'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/ce247fc08371e1b30cb52195e521c076.asciidoc b/docs/examples/guide/ce247fc08371e1b30cb52195e521c076.asciidoc
index a32269b6ad..c17bca3e37 100644
--- a/docs/examples/guide/ce247fc08371e1b30cb52195e521c076.asciidoc
+++ b/docs/examples/guide/ce247fc08371e1b30cb52195e521c076.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
},
filter: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
top_left: [
-74.1,
40.73
diff --git a/docs/examples/guide/ce899fcf55da72fc32e623d1ad88b301.asciidoc b/docs/examples/guide/ce899fcf55da72fc32e623d1ad88b301.asciidoc
index d417e621e7..ec7f7a3277 100644
--- a/docs/examples/guide/ce899fcf55da72fc32e623d1ad88b301.asciidoc
+++ b/docs/examples/guide/ce899fcf55da72fc32e623d1ad88b301.asciidoc
@@ -6,7 +6,7 @@ response = client.cluster.put_component_template(
template: {
mappings: {
properties: {
- "host.ip": {
+ 'host.ip' => {
type: 'ip'
}
}
diff --git a/docs/examples/guide/cf23f18761df33f08bc6f6d1875496fd.asciidoc b/docs/examples/guide/cf23f18761df33f08bc6f6d1875496fd.asciidoc
index 1c957c940e..b9b4ca57f2 100644
--- a/docs/examples/guide/cf23f18761df33f08bc6f6d1875496fd.asciidoc
+++ b/docs/examples/guide/cf23f18761df33f08bc6f6d1875496fd.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.put_settings(
index: 'my-index-000001',
body: {
index: {
- "routing.allocation.total_shards_per_node": 5
+ 'routing.allocation.total_shards_per_node' => 5
}
}
)
diff --git a/docs/examples/guide/cf5dab4334783ca9b8942eab68fb7174.asciidoc b/docs/examples/guide/cf5dab4334783ca9b8942eab68fb7174.asciidoc
index 19097edf50..32d9fb404e 100644
--- a/docs/examples/guide/cf5dab4334783ca9b8942eab68fb7174.asciidoc
+++ b/docs/examples/guide/cf5dab4334783ca9b8942eab68fb7174.asciidoc
@@ -21,7 +21,7 @@ response = client.search(
filter: [
{
term: {
- "resellers.reseller": 'companyB'
+ 'resellers.reseller' => 'companyB'
}
}
]
diff --git a/docs/examples/guide/d003ee256d24aa6000bd9dbf1d608dc5.asciidoc b/docs/examples/guide/d003ee256d24aa6000bd9dbf1d608dc5.asciidoc
new file mode 100644
index 0000000000..6b7d70b4fb
--- /dev/null
+++ b/docs/examples/guide/d003ee256d24aa6000bd9dbf1d608dc5.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.ingest.put_pipeline(
+ id: 'elser-v2-test',
+ body: {
+ processors: [
+ {
+ inference: {
+ model_id: '.elser_model_2',
+ input_output: [
+ {
+ input_field: 'content',
+ output_field: 'content_embedding'
+ }
+ ]
+ }
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/d01d309b0257d6fbca6d0941adeb3256.asciidoc b/docs/examples/guide/d01d309b0257d6fbca6d0941adeb3256.asciidoc
index 01291a575b..cc7e5bed9b 100644
--- a/docs/examples/guide/d01d309b0257d6fbca6d0941adeb3256.asciidoc
+++ b/docs/examples/guide/d01d309b0257d6fbca6d0941adeb3256.asciidoc
@@ -5,7 +5,7 @@ response = client.cluster.put_component_template(
body: {
template: {
settings: {
- "index.number_of_shards": 2
+ 'index.number_of_shards' => 2
}
}
}
@@ -17,7 +17,7 @@ response = client.cluster.put_component_template(
body: {
template: {
settings: {
- "index.number_of_replicas": 0
+ 'index.number_of_replicas' => 0
},
mappings: {
properties: {
diff --git a/docs/examples/guide/d03139a851888db53f8b7affd85eb495.asciidoc b/docs/examples/guide/d03139a851888db53f8b7affd85eb495.asciidoc
new file mode 100644
index 0000000000..b2689578e1
--- /dev/null
+++ b/docs/examples/guide/d03139a851888db53f8b7affd85eb495.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.check_in(
+ connector_id: 'my-connector'
+)
+puts response
+----
diff --git a/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc b/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc
new file mode 100644
index 0000000000..ba6b1c7ee4
--- /dev/null
+++ b/docs/examples/guide/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc
@@ -0,0 +1,63 @@
+[source, ruby]
+----
+response = client.bulk(
+ body: [
+ {
+ index: {
+ _index: 'books'
+ }
+ },
+ {
+ name: 'Revelation Space',
+ author: 'Alastair Reynolds',
+ release_date: '2000-03-15',
+ page_count: 585
+ },
+ {
+ index: {
+ _index: 'books'
+ }
+ },
+ {
+ name: '1984',
+ author: 'George Orwell',
+ release_date: '1985-06-01',
+ page_count: 328
+ },
+ {
+ index: {
+ _index: 'books'
+ }
+ },
+ {
+ name: 'Fahrenheit 451',
+ author: 'Ray Bradbury',
+ release_date: '1953-10-15',
+ page_count: 227
+ },
+ {
+ index: {
+ _index: 'books'
+ }
+ },
+ {
+ name: 'Brave New World',
+ author: 'Aldous Huxley',
+ release_date: '1932-06-01',
+ page_count: 268
+ },
+ {
+ index: {
+ _index: 'books'
+ }
+ },
+ {
+ name: 'The Handmaids Tale',
+ author: 'Margaret Atwood',
+ release_date: '1985-06-01',
+ page_count: 311
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/d0546f047359b85a7e98207dc8de896a.asciidoc b/docs/examples/guide/d0546f047359b85a7e98207dc8de896a.asciidoc
index 36ccdf84ed..9ff4eb92b0 100644
--- a/docs/examples/guide/d0546f047359b85a7e98207dc8de896a.asciidoc
+++ b/docs/examples/guide/d0546f047359b85a7e98207dc8de896a.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.create(
index: 'my-index-000001',
body: {
settings: {
- "index.mapping.coerce": false
+ 'index.mapping.coerce' => false
},
mappings: {
properties: {
diff --git a/docs/examples/guide/d05b2a37106fce0ebbd41e2fd6bd26c2.asciidoc b/docs/examples/guide/d05b2a37106fce0ebbd41e2fd6bd26c2.asciidoc
index 77be78daea..87b32cf62b 100644
--- a/docs/examples/guide/d05b2a37106fce0ebbd41e2fd6bd26c2.asciidoc
+++ b/docs/examples/guide/d05b2a37106fce0ebbd41e2fd6bd26c2.asciidoc
@@ -19,7 +19,7 @@ response = client.index(
id: 1,
refresh: true,
body: {
- "network.name": 'net-1',
+ 'network.name' => 'net-1',
latency_histo: {
values: [
0.1,
@@ -45,7 +45,7 @@ response = client.index(
id: 2,
refresh: true,
body: {
- "network.name": 'net-2',
+ 'network.name' => 'net-2',
latency_histo: {
values: [
0.1,
diff --git a/docs/examples/guide/d13c7cdfc976e0c7b70737cd6a7becb8.asciidoc b/docs/examples/guide/d13c7cdfc976e0c7b70737cd6a7becb8.asciidoc
index ce6ccb35c9..1e33001007 100644
--- a/docs/examples/guide/d13c7cdfc976e0c7b70737cd6a7becb8.asciidoc
+++ b/docs/examples/guide/d13c7cdfc976e0c7b70737cd6a7becb8.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "price.adjusted": {
+ 'price.adjusted' => {
type: 'double',
script: {
source: "emit(doc['price'].value * params.adjustment)",
diff --git a/docs/examples/guide/d14fe5838fc02224f4b5ade2626d6026.asciidoc b/docs/examples/guide/d14fe5838fc02224f4b5ade2626d6026.asciidoc
new file mode 100644
index 0000000000..2560f1c381
--- /dev/null
+++ b/docs/examples/guide/d14fe5838fc02224f4b5ade2626d6026.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.ilm.explain_lifecycle(
+ index: 'my-index-000001',
+ human: true
+)
+puts response
+----
diff --git a/docs/examples/guide/d29b00db13c625d4832e69635259db66.asciidoc b/docs/examples/guide/d29b00db13c625d4832e69635259db66.asciidoc
deleted file mode 100644
index c6e932ab8e..0000000000
--- a/docs/examples/guide/d29b00db13c625d4832e69635259db66.asciidoc
+++ /dev/null
@@ -1,7 +0,0 @@
-[source, ruby]
-----
-response = client.search(
- index: 'sample-01*'
-)
-puts response
-----
diff --git a/docs/examples/guide/d434219a4b2d26b22dfc0ce7969240c8.asciidoc b/docs/examples/guide/d434219a4b2d26b22dfc0ce7969240c8.asciidoc
deleted file mode 100644
index 8554f0126d..0000000000
--- a/docs/examples/guide/d434219a4b2d26b22dfc0ce7969240c8.asciidoc
+++ /dev/null
@@ -1,29 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'test_index',
- body: {
- settings: {
- index: {
- analysis: {
- analyzer: {
- search_synonyms: {
- tokenizer: 'whitespace',
- filter: [
- 'graph_synonyms'
- ]
- }
- },
- filter: {
- graph_synonyms: {
- type: 'synonym_graph',
- synonyms_path: 'analysis/synonym.txt'
- }
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/d49318764244113ad2ac4cc0f06d77ec.asciidoc b/docs/examples/guide/d49318764244113ad2ac4cc0f06d77ec.asciidoc
new file mode 100644
index 0000000000..d9ba8e8dc9
--- /dev/null
+++ b/docs/examples/guide/d49318764244113ad2ac4cc0f06d77ec.asciidoc
@@ -0,0 +1,23 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'image-index',
+ body: {
+ mappings: {
+ properties: {
+ "image-vector": {
+ type: 'dense_vector',
+ dims: 3,
+ similarity: 'l2_norm',
+ index_options: {
+ type: 'hnsw',
+ m: 32,
+ ef_construction: 100
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/d4fb482a51d67a1af48e429af6019a46.asciidoc b/docs/examples/guide/d4fb482a51d67a1af48e429af6019a46.asciidoc
index 53575aee58..494d3b6379 100644
--- a/docs/examples/guide/d4fb482a51d67a1af48e429af6019a46.asciidoc
+++ b/docs/examples/guide/d4fb482a51d67a1af48e429af6019a46.asciidoc
@@ -5,11 +5,11 @@ response = client.indices.create(
body: {
settings: {
index: {
- "sort.field": [
+ 'sort.field' => [
'username',
'date'
],
- "sort.order": [
+ 'sort.order' => [
'asc',
'desc'
]
diff --git a/docs/examples/guide/d5d022fac900b3244c3d24b185bb19e0.asciidoc b/docs/examples/guide/d5d022fac900b3244c3d24b185bb19e0.asciidoc
new file mode 100644
index 0000000000..def5c7a6a6
--- /dev/null
+++ b/docs/examples/guide/d5d022fac900b3244c3d24b185bb19e0.asciidoc
@@ -0,0 +1,30 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-image-index',
+ body: {
+ size: 10,
+ query: {
+ bool: {
+ must: {
+ knn: {
+ field: 'image-vector',
+ query_vector: [
+ -5,
+ 9,
+ -12
+ ],
+ num_candidates: 3
+ }
+ },
+ filter: {
+ term: {
+ "file-type": 'png'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/d64d509440afbed7cefd04b6898962eb.asciidoc b/docs/examples/guide/d64d509440afbed7cefd04b6898962eb.asciidoc
index 34fc1e51ab..bb5de5d801 100644
--- a/docs/examples/guide/d64d509440afbed7cefd04b6898962eb.asciidoc
+++ b/docs/examples/guide/d64d509440afbed7cefd04b6898962eb.asciidoc
@@ -11,7 +11,7 @@ response = client.search(
filter: {
geo_distance: {
distance: '200km',
- "pin.location": {
+ 'pin.location' => {
lat: 40,
lon: -70
}
diff --git a/docs/examples/guide/d66e2b4d1931bf88c72e74670156e43f.asciidoc b/docs/examples/guide/d66e2b4d1931bf88c72e74670156e43f.asciidoc
index 1da82c4aae..d1654a1502 100644
--- a/docs/examples/guide/d66e2b4d1931bf88c72e74670156e43f.asciidoc
+++ b/docs/examples/guide/d66e2b4d1931bf88c72e74670156e43f.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
track_total_hits: 100,
query: {
match: {
- "user.id": 'elkbee'
+ 'user.id' => 'elkbee'
}
}
}
diff --git a/docs/examples/guide/d690a6af462c70a783625a323e11c72c.asciidoc b/docs/examples/guide/d690a6af462c70a783625a323e11c72c.asciidoc
index 33f926266d..6f092450de 100644
--- a/docs/examples/guide/d690a6af462c70a783625a323e11c72c.asciidoc
+++ b/docs/examples/guide/d690a6af462c70a783625a323e11c72c.asciidoc
@@ -6,7 +6,7 @@ response = client.indices.create(
settings: {
number_of_shards: 1,
number_of_replicas: 1,
- "index.lifecycle.name": 'my_policy'
+ 'index.lifecycle.name' => 'my_policy'
}
}
)
diff --git a/docs/examples/guide/d6c3659339ef4f2d47425e09eccbf939.asciidoc b/docs/examples/guide/d6c3659339ef4f2d47425e09eccbf939.asciidoc
deleted file mode 100644
index 5b41e27968..0000000000
--- a/docs/examples/guide/d6c3659339ef4f2d47425e09eccbf939.asciidoc
+++ /dev/null
@@ -1,19 +0,0 @@
-[source, ruby]
-----
-response = client.cluster.put_component_template(
- name: 'my-weather-sensor-settings',
- body: {
- template: {
- settings: {
- "index.lifecycle.name": 'my-lifecycle-policy',
- "index.look_ahead_time": '3h',
- "index.codec": 'best_compression'
- }
- },
- _meta: {
- description: 'Index settings for weather sensor data'
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/d70f55cd29cdb2dcd775ffa9e23ff393.asciidoc b/docs/examples/guide/d70f55cd29cdb2dcd775ffa9e23ff393.asciidoc
index 34cbaf1a1f..6bc65c851e 100644
--- a/docs/examples/guide/d70f55cd29cdb2dcd775ffa9e23ff393.asciidoc
+++ b/docs/examples/guide/d70f55cd29cdb2dcd775ffa9e23ff393.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "price.adjusted": {
+ 'price.adjusted' => {
type: 'double',
script: "\n double price = doc['price'].value;\n if (doc['promoted'].value) {\n price *= 0.8;\n }\n emit(price);\n "
}
diff --git a/docs/examples/guide/d7a55a7c491e97079e429483085f1d58.asciidoc b/docs/examples/guide/d7a55a7c491e97079e429483085f1d58.asciidoc
new file mode 100644
index 0000000000..2531d6787d
--- /dev/null
+++ b/docs/examples/guide/d7a55a7c491e97079e429483085f1d58.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'dsl-data-stream-template',
+ body: {
+ index_patterns: [
+ 'dsl-data-stream*'
+ ],
+ data_stream: {},
+ priority: 500,
+ template: {
+ settings: {
+ 'index.lifecycle.name' => 'pre-dsl-ilm-policy'
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/d8310e5606c61e7a6e64a90838b1a830.asciidoc b/docs/examples/guide/d8310e5606c61e7a6e64a90838b1a830.asciidoc
new file mode 100644
index 0000000000..f884f49b3a
--- /dev/null
+++ b/docs/examples/guide/d8310e5606c61e7a6e64a90838b1a830.asciidoc
@@ -0,0 +1,43 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'parent_example',
+ id: 2,
+ routing: 1,
+ body: {
+ join: {
+ name: 'answer',
+ parent: '1'
+ },
+ owner: {
+ location: 'Norfolk, United Kingdom',
+ display_name: 'Sam',
+ id: 48
+ },
+ body: "Unfortunately you're pretty much limited to FTP...",
+ creation_date: '2009-05-04T13:45:37.030'
+ }
+)
+puts response
+
+response = client.index(
+ index: 'parent_example',
+ id: 3,
+ routing: 1,
+ refresh: true,
+ body: {
+ join: {
+ name: 'answer',
+ parent: '1'
+ },
+ owner: {
+ location: 'Norfolk, United Kingdom',
+ display_name: 'Troll',
+ id: 49
+ },
+ body: 'Use Linux...',
+ creation_date: '2009-05-05T13:45:37.030'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/d8ea6a1a1c546bf29f65f8c65439b156.asciidoc b/docs/examples/guide/d8ea6a1a1c546bf29f65f8c65439b156.asciidoc
new file mode 100644
index 0000000000..35bb975b4f
--- /dev/null
+++ b/docs/examples/guide/d8ea6a1a1c546bf29f65f8c65439b156.asciidoc
@@ -0,0 +1,21 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'byte-image-index',
+ body: {
+ mappings: {
+ properties: {
+ "byte-image-vector": {
+ type: 'dense_vector',
+ element_type: 'byte',
+ dims: 2
+ },
+ title: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/d93d52b6057a7aff3d0766ca44c505e0.asciidoc b/docs/examples/guide/d93d52b6057a7aff3d0766ca44c505e0.asciidoc
new file mode 100644
index 0000000000..9885296749
--- /dev/null
+++ b/docs/examples/guide/d93d52b6057a7aff3d0766ca44c505e0.asciidoc
@@ -0,0 +1,34 @@
+[source, ruby]
+----
+response = client.cluster.put_component_template(
+ name: 'my-aliases',
+ body: {
+ template: {
+ aliases: {
+ "my-alias": {}
+ }
+ }
+ }
+)
+puts response
+
+response = client.indices.put_index_template(
+ name: 'my-index-template',
+ body: {
+ index_patterns: [
+ 'my-index-*'
+ ],
+ composed_of: [
+ 'my-aliases',
+ 'my-mappings',
+ 'my-settings'
+ ],
+ template: {
+ aliases: {
+ "yet-another-alias": {}
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/d952ac7c73219d8cabc080679e035514.asciidoc b/docs/examples/guide/d952ac7c73219d8cabc080679e035514.asciidoc
new file mode 100644
index 0000000000..adcc2c5c5f
--- /dev/null
+++ b/docs/examples/guide/d952ac7c73219d8cabc080679e035514.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ knn: {
+ field: 'my_embeddings.predicted_value',
+ k: 10,
+ num_candidates: 100,
+ query_vector_builder: {
+ text_embedding: {
+ model_id: 'sentence-transformers__msmarco-minilm-l-12-v3',
+ model_text: 'the query string'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/d979f934af0992fb8c8596beff80b638.asciidoc b/docs/examples/guide/d979f934af0992fb8c8596beff80b638.asciidoc
index e55d8f876e..40a467c6f4 100644
--- a/docs/examples/guide/d979f934af0992fb8c8596beff80b638.asciidoc
+++ b/docs/examples/guide/d979f934af0992fb8c8596beff80b638.asciidoc
@@ -8,7 +8,7 @@ response = client.search(
],
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/d9fd6c552e904261fd52884595e28eff.asciidoc b/docs/examples/guide/d9fd6c552e904261fd52884595e28eff.asciidoc
deleted file mode 100644
index 7a95aefe96..0000000000
--- a/docs/examples/guide/d9fd6c552e904261fd52884595e28eff.asciidoc
+++ /dev/null
@@ -1,26 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'test_index',
- body: {
- settings: {
- index: {
- analysis: {
- filter: {
- synonym: {
- type: 'synonym_graph',
- format: 'wordnet',
- synonyms: [
- "s(100000001,1,'abstain',v,1,0).",
- "s(100000001,2,'refrain',v,1,0).",
- "s(100000001,3,'desist',v,1,0)."
- ]
- }
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/da3cecc36a7313385d32c7f52ccfb7e3.asciidoc b/docs/examples/guide/da3cecc36a7313385d32c7f52ccfb7e3.asciidoc
index b109d0c582..e60211e765 100644
--- a/docs/examples/guide/da3cecc36a7313385d32c7f52ccfb7e3.asciidoc
+++ b/docs/examples/guide/da3cecc36a7313385d32c7f52ccfb7e3.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
size: 0,
body: {
runtime_mappings: {
- "date.day_of_week": {
+ 'date.day_of_week' => {
type: 'keyword',
script: "emit(doc['date'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
}
diff --git a/docs/examples/guide/daae2e6acebc84e537764f4ba07f2e6e.asciidoc b/docs/examples/guide/daae2e6acebc84e537764f4ba07f2e6e.asciidoc
index b543b2e8fa..24b505387e 100644
--- a/docs/examples/guide/daae2e6acebc84e537764f4ba07f2e6e.asciidoc
+++ b/docs/examples/guide/daae2e6acebc84e537764f4ba07f2e6e.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.exclude._name": nil
+ 'cluster.routing.allocation.exclude._name' => nil
}
}
)
diff --git a/docs/examples/guide/dad2d4add751fde5c39475ca709cc14b.asciidoc b/docs/examples/guide/dad2d4add751fde5c39475ca709cc14b.asciidoc
index d737e103ad..334da4cdc6 100644
--- a/docs/examples/guide/dad2d4add751fde5c39475ca709cc14b.asciidoc
+++ b/docs/examples/guide/dad2d4add751fde5c39475ca709cc14b.asciidoc
@@ -3,7 +3,7 @@
response = client.indices.put_settings(
index: 'test',
body: {
- "index.routing.allocation.include.size": 'big,medium'
+ 'index.routing.allocation.include.size' => 'big,medium'
}
)
puts response
diff --git a/docs/examples/guide/dadb69a225778ecd6528924c0aa029bb.asciidoc b/docs/examples/guide/dadb69a225778ecd6528924c0aa029bb.asciidoc
new file mode 100644
index 0000000000..de223a33ef
--- /dev/null
+++ b/docs/examples/guide/dadb69a225778ecd6528924c0aa029bb.asciidoc
@@ -0,0 +1,29 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'image-index',
+ body: {
+ mappings: {
+ properties: {
+ "image-vector": {
+ type: 'dense_vector',
+ dims: 3,
+ similarity: 'l2_norm'
+ },
+ "title-vector": {
+ type: 'dense_vector',
+ dims: 5,
+ similarity: 'l2_norm'
+ },
+ title: {
+ type: 'text'
+ },
+ "file-type": {
+ type: 'keyword'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/dbf93d02ab86a09929a21232b19709cc.asciidoc b/docs/examples/guide/dbf93d02ab86a09929a21232b19709cc.asciidoc
new file mode 100644
index 0000000000..6b1ec1c2cb
--- /dev/null
+++ b/docs/examples/guide/dbf93d02ab86a09929a21232b19709cc.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.ml.stop_trained_model_deployment(
+ model_id: 'my_model_for_search'
+)
+puts response
+----
diff --git a/docs/examples/guide/dc3b7603e7d688106acb804059af7834.asciidoc b/docs/examples/guide/dc3b7603e7d688106acb804059af7834.asciidoc
index e661864ba6..4dd54b03c4 100644
--- a/docs/examples/guide/dc3b7603e7d688106acb804059af7834.asciidoc
+++ b/docs/examples/guide/dc3b7603e7d688106acb804059af7834.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
_source: false,
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/dd360e1cf42ad897e2ab9e785a45466f.asciidoc b/docs/examples/guide/dd360e1cf42ad897e2ab9e785a45466f.asciidoc
deleted file mode 100644
index 506a2c936a..0000000000
--- a/docs/examples/guide/dd360e1cf42ad897e2ab9e785a45466f.asciidoc
+++ /dev/null
@@ -1,30 +0,0 @@
-[source, ruby]
-----
-response = client.indices.put_index_template(
- name: 'my-weather-sensor-index-template',
- body: {
- index_patterns: [
- 'metrics-weather_sensors-*'
- ],
- data_stream: {},
- template: {
- settings: {
- "index.mode": 'time_series',
- "index.routing_path": [
- 'sensor_id',
- 'location'
- ]
- }
- },
- composed_of: [
- 'my-weather-sensor-mappings',
- 'my-weather-sensor-settings'
- ],
- priority: 500,
- _meta: {
- description: 'Template for my weather sensor data'
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/de139866a220124360e5e27d1a736ea4.asciidoc b/docs/examples/guide/de139866a220124360e5e27d1a736ea4.asciidoc
index 2f51e4ec7b..20620e085a 100644
--- a/docs/examples/guide/de139866a220124360e5e27d1a736ea4.asciidoc
+++ b/docs/examples/guide/de139866a220124360e5e27d1a736ea4.asciidoc
@@ -9,14 +9,14 @@ response = client.search(
},
sort: [
{
- "offer.price": {
+ 'offer.price' => {
mode: 'avg',
order: 'asc',
nested: {
path: 'offer',
filter: {
term: {
- "offer.color": 'blue'
+ 'offer.color' => 'blue'
}
}
}
diff --git a/docs/examples/guide/de876505acc75d371d1f6f484c449197.asciidoc b/docs/examples/guide/de876505acc75d371d1f6f484c449197.asciidoc
index f903a15c84..3556e3f30a 100644
--- a/docs/examples/guide/de876505acc75d371d1f6f484c449197.asciidoc
+++ b/docs/examples/guide/de876505acc75d371d1f6f484c449197.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.create(
index: 'test',
body: {
settings: {
- "index.write.wait_for_active_shards": '2'
+ 'index.write.wait_for_active_shards' => '2'
}
}
)
diff --git a/docs/examples/guide/dea4ac54c63a10c62eccd7b7f6543b86.asciidoc b/docs/examples/guide/dea4ac54c63a10c62eccd7b7f6543b86.asciidoc
new file mode 100644
index 0000000000..f2e1dfb22a
--- /dev/null
+++ b/docs/examples/guide/dea4ac54c63a10c62eccd7b7f6543b86.asciidoc
@@ -0,0 +1,23 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'place',
+ id: 1,
+ body: {
+ suggest: {
+ input: [
+ "timmy's",
+ 'starbucks',
+ 'dunkin donuts'
+ ],
+ contexts: {
+ place_type: [
+ 'cafe',
+ 'food'
+ ]
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/dead0682932ea6ec33c1197017bcb209.asciidoc b/docs/examples/guide/dead0682932ea6ec33c1197017bcb209.asciidoc
index 6531303512..7a005bd91f 100644
--- a/docs/examples/guide/dead0682932ea6ec33c1197017bcb209.asciidoc
+++ b/docs/examples/guide/dead0682932ea6ec33c1197017bcb209.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
},
filter: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
top_left: 'dr5r9ydj2y73',
bottom_right: 'drj7teegpus6'
}
diff --git a/docs/examples/guide/df1336e768fb6fc1826a5afa30a57285.asciidoc b/docs/examples/guide/df1336e768fb6fc1826a5afa30a57285.asciidoc
new file mode 100644
index 0000000000..35589a0a25
--- /dev/null
+++ b/docs/examples/guide/df1336e768fb6fc1826a5afa30a57285.asciidoc
@@ -0,0 +1,14 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'my-data-stream',
+ body: {
+ "@timestamp": '2099-03-08T11:06:07.000Z',
+ user: {
+ id: '8a4f500d'
+ },
+ message: 'Login successful'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc b/docs/examples/guide/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc
index 07ba02d610..d6d23c72a5 100644
--- a/docs/examples/guide/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc
+++ b/docs/examples/guide/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc
@@ -70,7 +70,7 @@ response = client.search(
must_not: [
{
term: {
- "comments.author": 'nik9000'
+ 'comments.author' => 'nik9000'
}
}
]
diff --git a/docs/examples/guide/df8271648f547673007ecd778341bfc9.asciidoc b/docs/examples/guide/df8271648f547673007ecd778341bfc9.asciidoc
new file mode 100644
index 0000000000..430bbd5b72
--- /dev/null
+++ b/docs/examples/guide/df8271648f547673007ecd778341bfc9.asciidoc
@@ -0,0 +1,53 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'mv',
+ body: {
+ mappings: {
+ properties: {
+ b: {
+ type: 'keyword'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.bulk(
+ index: 'mv',
+ refresh: true,
+ body: [
+ {
+ index: {}
+ },
+ {
+ a: 1,
+ b: [
+ 'foo',
+ 'foo',
+ 'bar'
+ ]
+ },
+ {
+ index: {}
+ },
+ {
+ a: 2,
+ b: [
+ 'bar',
+ 'bar'
+ ]
+ }
+ ]
+)
+puts response
+
+response = client.esql.query(
+ body: {
+ query: 'FROM mv | LIMIT 2',
+ version: '2024.04.01'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/dfb20907cfc5ac520ea3b1dba5f00811.asciidoc b/docs/examples/guide/dfb20907cfc5ac520ea3b1dba5f00811.asciidoc
index 398466cb62..8f789c07f9 100644
--- a/docs/examples/guide/dfb20907cfc5ac520ea3b1dba5f00811.asciidoc
+++ b/docs/examples/guide/dfb20907cfc5ac520ea3b1dba5f00811.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
sort: [
{
- "result.execution_time": 'desc'
+ 'result.execution_time' => 'desc'
}
]
}
diff --git a/docs/examples/guide/dfdf82b8d99436582f150117695190b3.asciidoc b/docs/examples/guide/dfdf82b8d99436582f150117695190b3.asciidoc
new file mode 100644
index 0000000000..d22bd4f8f9
--- /dev/null
+++ b/docs/examples/guide/dfdf82b8d99436582f150117695190b3.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'child_example',
+ id: 1,
+ body: {
+ join: {
+ name: 'question'
+ },
+ body: 'I have Windows 2003 server and i bought a new Windows 2008 server...',
+ title: 'Whats the best way to file transfer my site from server to a newer one?',
+ tags: [
+ 'windows-server-2003',
+ 'windows-server-2008',
+ 'file-transfer'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e04c55476de6e785a066d3b43f66d20d.asciidoc b/docs/examples/guide/e04c55476de6e785a066d3b43f66d20d.asciidoc
new file mode 100644
index 0000000000..bb2bfef424
--- /dev/null
+++ b/docs/examples/guide/e04c55476de6e785a066d3b43f66d20d.asciidoc
@@ -0,0 +1,31 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ query: {
+ bool: {
+ should: [
+ {
+ text_expansion: {
+ content_embedding: {
+ model_text: 'How to avoid muscle soreness after running?',
+ model_id: '.elser_model_2',
+ boost: 1
+ }
+ }
+ },
+ {
+ query_string: {
+ query: 'toxins',
+ boost: 4
+ }
+ }
+ ]
+ }
+ },
+ min_score: 10
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e12f2d2ddca387630e7855a6db952da2.asciidoc b/docs/examples/guide/e12f2d2ddca387630e7855a6db952da2.asciidoc
index 8b5749d783..2147370c2b 100644
--- a/docs/examples/guide/e12f2d2ddca387630e7855a6db952da2.asciidoc
+++ b/docs/examples/guide/e12f2d2ddca387630e7855a6db952da2.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
index: 'sales',
body: {
runtime_mappings: {
- "price.euros": {
+ 'price.euros' => {
type: 'double',
script: {
source: "\n emit(doc['price'].value * params.conversion_rate)\n ",
diff --git a/docs/examples/guide/e20037f66bf54bcac7d10f536f031f34.asciidoc b/docs/examples/guide/e20037f66bf54bcac7d10f536f031f34.asciidoc
index 5d1dbb4af0..b811337269 100644
--- a/docs/examples/guide/e20037f66bf54bcac7d10f536f031f34.asciidoc
+++ b/docs/examples/guide/e20037f66bf54bcac7d10f536f031f34.asciidoc
@@ -3,7 +3,7 @@
response = client.indices.put_settings(
index: 'my-index-000001',
body: {
- "index.blocks.read_only_allow_delete": nil
+ 'index.blocks.read_only_allow_delete' => nil
}
)
puts response
diff --git a/docs/examples/guide/e26c96978096ccc592849cca9db67ffc.asciidoc b/docs/examples/guide/e26c96978096ccc592849cca9db67ffc.asciidoc
index b4834f26cd..4e09f775fd 100644
--- a/docs/examples/guide/e26c96978096ccc592849cca9db67ffc.asciidoc
+++ b/docs/examples/guide/e26c96978096ccc592849cca9db67ffc.asciidoc
@@ -3,7 +3,7 @@
response = client.indices.put_settings(
index: 'my-index-000001',
body: {
- "index.requests.cache.enable": true
+ 'index.requests.cache.enable' => true
}
)
puts response
diff --git a/docs/examples/guide/e26e8bfa68aa4ab265b22304c38c3aef.asciidoc b/docs/examples/guide/e26e8bfa68aa4ab265b22304c38c3aef.asciidoc
new file mode 100644
index 0000000000..50f5d6690c
--- /dev/null
+++ b/docs/examples/guide/e26e8bfa68aa4ab265b22304c38c3aef.asciidoc
@@ -0,0 +1,89 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'sample_data',
+ body: {
+ mappings: {
+ properties: {
+ client_ip: {
+ type: 'ip'
+ },
+ message: {
+ type: 'keyword'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.bulk(
+ index: 'sample_data',
+ body: [
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-10-23T12:15:03.360Z',
+ client_ip: '172.21.2.162',
+ message: 'Connected to 10.1.0.3',
+ event_duration: 3_450_233
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-10-23T12:27:28.948Z',
+ client_ip: '172.21.2.113',
+ message: 'Connected to 10.1.0.2',
+ event_duration: 2_764_889
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-10-23T13:33:34.937Z',
+ client_ip: '172.21.0.5',
+ message: 'Disconnected',
+ event_duration: 1_232_382
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-10-23T13:51:54.732Z',
+ client_ip: '172.21.3.15',
+ message: 'Connection error',
+ event_duration: 725_448
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-10-23T13:52:55.015Z',
+ client_ip: '172.21.3.15',
+ message: 'Connection error',
+ event_duration: 8_268_153
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-10-23T13:53:55.832Z',
+ client_ip: '172.21.3.15',
+ message: 'Connection error',
+ event_duration: 5_033_755
+ },
+ {
+ index: {}
+ },
+ {
+ "@timestamp": '2023-10-23T13:55:01.543Z',
+ client_ip: '172.21.3.15',
+ message: 'Connected to 10.1.0.1',
+ event_duration: 1_756_467
+ }
+ ]
+)
+puts response
+----
diff --git a/docs/examples/guide/e2a753029b450942a3228e3003a55a7d.asciidoc b/docs/examples/guide/e2a753029b450942a3228e3003a55a7d.asciidoc
new file mode 100644
index 0000000000..7591a7ad90
--- /dev/null
+++ b/docs/examples/guide/e2a753029b450942a3228e3003a55a7d.asciidoc
@@ -0,0 +1,19 @@
+[source, ruby]
+----
+response = client.indices.put_data_lifecycle(
+ name: 'my-weather-sensor-data-stream',
+ body: {
+ downsampling: [
+ {
+ after: '1d',
+ fixed_interval: '10m'
+ },
+ {
+ after: '7d',
+ fixed_interval: '1d'
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e2b4867a9f72bda87ebaa3608d3fba4c.asciidoc b/docs/examples/guide/e2b4867a9f72bda87ebaa3608d3fba4c.asciidoc
index d7e2a305e8..f384a25852 100644
--- a/docs/examples/guide/e2b4867a9f72bda87ebaa3608d3fba4c.asciidoc
+++ b/docs/examples/guide/e2b4867a9f72bda87ebaa3608d3fba4c.asciidoc
@@ -5,7 +5,7 @@ response = client.render_search_template(
source: {
query: {
range: {
- "user.effective.date": {
+ 'user.effective.date' => {
gte: '{{date.min}}',
lte: '{{date.max}}',
format: "{{#join delimiter='||'}}date.formats{{/join delimiter='||'}}"
diff --git a/docs/examples/guide/e2bcc8f4ed2b4de82729e7a5a7c8f634.asciidoc b/docs/examples/guide/e2bcc8f4ed2b4de82729e7a5a7c8f634.asciidoc
new file mode 100644
index 0000000000..b7ffe68064
--- /dev/null
+++ b/docs/examples/guide/e2bcc8f4ed2b4de82729e7a5a7c8f634.asciidoc
@@ -0,0 +1,5 @@
+[source, ruby]
+----
+response = client.synonyms.get_synonyms_sets
+puts response
+----
diff --git a/docs/examples/guide/e317a8380dfbc76c4e7f23d0997b3518.asciidoc b/docs/examples/guide/e317a8380dfbc76c4e7f23d0997b3518.asciidoc
index e341b0699f..36a1537d7e 100644
--- a/docs/examples/guide/e317a8380dfbc76c4e7f23d0997b3518.asciidoc
+++ b/docs/examples/guide/e317a8380dfbc76c4e7f23d0997b3518.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "action.destructive_requires_name": nil
+ 'action.destructive_requires_name' => nil
}
}
)
diff --git a/docs/examples/guide/e324ea1547635180c31c1adf77870ba2.asciidoc b/docs/examples/guide/e324ea1547635180c31c1adf77870ba2.asciidoc
new file mode 100644
index 0000000000..106e1b5a74
--- /dev/null
+++ b/docs/examples/guide/e324ea1547635180c31c1adf77870ba2.asciidoc
@@ -0,0 +1,42 @@
+[source, ruby]
+----
+response = client.cluster.put_component_template(
+ name: 'destination_template',
+ body: {
+ template: {
+ settings: {
+ index: {
+ number_of_replicas: 2,
+ number_of_shards: 2,
+ mode: 'time_series',
+ routing_path: [
+ 'metricset'
+ ]
+ }
+ },
+ mappings: {
+ properties: {
+ "@timestamp": {
+ type: 'date'
+ },
+ metricset: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ "k8s": {
+ properties: {
+ tx: {
+ type: 'long'
+ },
+ rx: {
+ type: 'long'
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e3b3a8ae12ab947ad3ba96eb228402ca.asciidoc b/docs/examples/guide/e3b3a8ae12ab947ad3ba96eb228402ca.asciidoc
index 318a0c17b4..269fc6f98d 100644
--- a/docs/examples/guide/e3b3a8ae12ab947ad3ba96eb228402ca.asciidoc
+++ b/docs/examples/guide/e3b3a8ae12ab947ad3ba96eb228402ca.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.create(
index: 'my-index-000001',
body: {
settings: {
- "index.store.preload": [
+ 'index.store.preload' => [
'nvd',
'dvd'
]
diff --git a/docs/examples/guide/e3f2f6ee3e312b8a90634827ae954d70.asciidoc b/docs/examples/guide/e3f2f6ee3e312b8a90634827ae954d70.asciidoc
new file mode 100644
index 0000000000..5433a1f0cb
--- /dev/null
+++ b/docs/examples/guide/e3f2f6ee3e312b8a90634827ae954d70.asciidoc
@@ -0,0 +1,34 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'GeometryCollection',
+ geometries: [
+ {
+ type: 'Point',
+ coordinates: [
+ 100,
+ 0
+ ]
+ },
+ {
+ type: 'LineString',
+ coordinates: [
+ [
+ 101,
+ 0
+ ],
+ [
+ 102,
+ 1
+ ]
+ ]
+ }
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e46c83db1580e14be844079cd008f518.asciidoc b/docs/examples/guide/e46c83db1580e14be844079cd008f518.asciidoc
index 05ba05553d..363ef500ed 100644
--- a/docs/examples/guide/e46c83db1580e14be844079cd008f518.asciidoc
+++ b/docs/examples/guide/e46c83db1580e14be844079cd008f518.asciidoc
@@ -4,7 +4,7 @@ response = client.indices.put_settings(
index: 'my-index-000001',
body: {
index: {
- "routing.allocation.enable": 'all'
+ 'routing.allocation.enable' => 'all'
}
}
)
diff --git a/docs/examples/guide/e4d1f01c025fb797a1d87f372760eabf.asciidoc b/docs/examples/guide/e4d1f01c025fb797a1d87f372760eabf.asciidoc
new file mode 100644
index 0000000000..143ab2ffcc
--- /dev/null
+++ b/docs/examples/guide/e4d1f01c025fb797a1d87f372760eabf.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.tasks.list(
+ human: true,
+ detailed: true
+)
+puts response
+----
diff --git a/docs/examples/guide/e4de6035653e8202c43631f02d244661.asciidoc b/docs/examples/guide/e4de6035653e8202c43631f02d244661.asciidoc
new file mode 100644
index 0000000000..1b553355f5
--- /dev/null
+++ b/docs/examples/guide/e4de6035653e8202c43631f02d244661.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'cluster_one:my-index-000001',
+ body: {
+ size: 1,
+ query: {
+ match: {
+ 'user.id' => 'kimchy'
+ }
+ },
+ _source: [
+ 'user.id',
+ 'message',
+ 'http.response.status_code'
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e551ea38a2d8f8deac110b33304200cc.asciidoc b/docs/examples/guide/e551ea38a2d8f8deac110b33304200cc.asciidoc
new file mode 100644
index 0000000000..33b81209a1
--- /dev/null
+++ b/docs/examples/guide/e551ea38a2d8f8deac110b33304200cc.asciidoc
@@ -0,0 +1,27 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ query: {
+ multi_match: {
+ fields: [
+ 'title',
+ 'content'
+ ],
+ query: 'the quick brown fox'
+ }
+ },
+ rescore: {
+ learning_to_rank: {
+ model_id: 'ltr-model',
+ params: {
+ query_text: 'the quick brown fox'
+ }
+ },
+ window_size: 100
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e58833449d01379df20ad06dc28144d8.asciidoc b/docs/examples/guide/e58833449d01379df20ad06dc28144d8.asciidoc
index 014470ce4e..54247101db 100644
--- a/docs/examples/guide/e58833449d01379df20ad06dc28144d8.asciidoc
+++ b/docs/examples/guide/e58833449d01379df20ad06dc28144d8.asciidoc
@@ -6,7 +6,7 @@ response = client.update_by_query(
body: {
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/e5901f48eb8a419b878fc2cb815d8691.asciidoc b/docs/examples/guide/e5901f48eb8a419b878fc2cb815d8691.asciidoc
index a06dc93c02..f0edf74839 100644
--- a/docs/examples/guide/e5901f48eb8a419b878fc2cb815d8691.asciidoc
+++ b/docs/examples/guide/e5901f48eb8a419b878fc2cb815d8691.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "indices.recovery.max_bytes_per_sec": '50mb'
+ 'indices.recovery.max_bytes_per_sec' => '50mb'
}
}
)
diff --git a/docs/examples/guide/e5f8f83df37ab2296dc4bfed95d7aba7.asciidoc b/docs/examples/guide/e5f8f83df37ab2296dc4bfed95d7aba7.asciidoc
index 0680ade6eb..a152187d74 100644
--- a/docs/examples/guide/e5f8f83df37ab2296dc4bfed95d7aba7.asciidoc
+++ b/docs/examples/guide/e5f8f83df37ab2296dc4bfed95d7aba7.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.enable": 'all'
+ 'cluster.routing.allocation.enable' => 'all'
}
}
)
diff --git a/docs/examples/guide/e608cd0c034f6c245ea87f425e09ce2f.asciidoc b/docs/examples/guide/e608cd0c034f6c245ea87f425e09ce2f.asciidoc
index 0ed07fc4fd..3a0410df15 100644
--- a/docs/examples/guide/e608cd0c034f6c245ea87f425e09ce2f.asciidoc
+++ b/docs/examples/guide/e608cd0c034f6c245ea87f425e09ce2f.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
span_term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/e6369e7cef82d881af593d5526bf79bd.asciidoc b/docs/examples/guide/e6369e7cef82d881af593d5526bf79bd.asciidoc
index d36b6d2cd9..e4b2122a1c 100644
--- a/docs/examples/guide/e6369e7cef82d881af593d5526bf79bd.asciidoc
+++ b/docs/examples/guide/e6369e7cef82d881af593d5526bf79bd.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
span_term: {
- "user.id": {
+ 'user.id' => {
value: 'kimchy',
boost: 2
}
diff --git a/docs/examples/guide/e642be44a62a89cf4afb2db28220c9a9.asciidoc b/docs/examples/guide/e642be44a62a89cf4afb2db28220c9a9.asciidoc
index 0165a3d888..33cd07e9f1 100644
--- a/docs/examples/guide/e642be44a62a89cf4afb2db28220c9a9.asciidoc
+++ b/docs/examples/guide/e642be44a62a89cf4afb2db28220c9a9.asciidoc
@@ -3,8 +3,8 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "ingest.geoip.downloader.enabled": true,
- "indices.lifecycle.history_index_enabled": true
+ 'ingest.geoip.downloader.enabled' => true,
+ 'indices.lifecycle.history_index_enabled' => true
}
}
)
diff --git a/docs/examples/guide/e84e23232c7ecc8d6377ec2c16a60269.asciidoc b/docs/examples/guide/e84e23232c7ecc8d6377ec2c16a60269.asciidoc
index b9822ec31a..d39c1ff733 100644
--- a/docs/examples/guide/e84e23232c7ecc8d6377ec2c16a60269.asciidoc
+++ b/docs/examples/guide/e84e23232c7ecc8d6377ec2c16a60269.asciidoc
@@ -8,7 +8,7 @@ response = client.indices.create(
"alias_2": {
filter: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
routing: 'shard-1'
diff --git a/docs/examples/guide/e88a057a13e191e4d5faa22edf2ae8ed.asciidoc b/docs/examples/guide/e88a057a13e191e4d5faa22edf2ae8ed.asciidoc
new file mode 100644
index 0000000000..131a7fe7c7
--- /dev/null
+++ b/docs/examples/guide/e88a057a13e191e4d5faa22edf2ae8ed.asciidoc
@@ -0,0 +1,8 @@
+[source, ruby]
+----
+response = client.cluster.get_settings(
+ filter_path: '**.xpack.profiling.templates.enabled',
+ include_defaults: true
+)
+puts response
+----
diff --git a/docs/examples/guide/e930a572e8ddfdecc13498c04007b9e3.asciidoc b/docs/examples/guide/e930a572e8ddfdecc13498c04007b9e3.asciidoc
new file mode 100644
index 0000000000..74197fa382
--- /dev/null
+++ b/docs/examples/guide/e930a572e8ddfdecc13498c04007b9e3.asciidoc
@@ -0,0 +1,22 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'openai-embeddings',
+ body: {
+ mappings: {
+ properties: {
+ content_embedding: {
+ type: 'dense_vector',
+ dims: 1536,
+ element_type: 'float',
+ similarity: 'dot_product'
+ },
+ content: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e93ff228ab3e63738e1c83fdfb7424b9.asciidoc b/docs/examples/guide/e93ff228ab3e63738e1c83fdfb7424b9.asciidoc
index f2ffb37a61..f023deb367 100644
--- a/docs/examples/guide/e93ff228ab3e63738e1c83fdfb7424b9.asciidoc
+++ b/docs/examples/guide/e93ff228ab3e63738e1c83fdfb7424b9.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
match: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
highlight: {
diff --git a/docs/examples/guide/e95e61988dc3073a007f7b7445dd233b.asciidoc b/docs/examples/guide/e95e61988dc3073a007f7b7445dd233b.asciidoc
new file mode 100644
index 0000000000..3e18e16ab3
--- /dev/null
+++ b/docs/examples/guide/e95e61988dc3073a007f7b7445dd233b.asciidoc
@@ -0,0 +1,23 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'dsl-data-stream-template',
+ body: {
+ index_patterns: [
+ 'dsl-data-stream*'
+ ],
+ data_stream: {},
+ priority: 500,
+ template: {
+ settings: {
+ 'index.lifecycle.name' => 'pre-dsl-ilm-policy',
+ 'index.lifecycle.prefer_ilm' => false
+ },
+ lifecycle: {
+ data_retention: '7d'
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e9a0b450af6219772631703d602c7092.asciidoc b/docs/examples/guide/e9a0b450af6219772631703d602c7092.asciidoc
new file mode 100644
index 0000000000..9e7fde1465
--- /dev/null
+++ b/docs/examples/guide/e9a0b450af6219772631703d602c7092.asciidoc
@@ -0,0 +1,40 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ query: {
+ text_expansion: {
+ 'ml.tokens' => {
+ model_id: '.elser_model_2',
+ model_text: 'How is the weather in Jamaica?',
+ pruning_config: {
+ tokens_freq_ratio_threshold: 5,
+ tokens_weight_threshold: 0.4,
+ only_score_pruned_tokens: false
+ }
+ }
+ }
+ },
+ rescore: {
+ window_size: 100,
+ query: {
+ rescore_query: {
+ text_expansion: {
+ 'ml.tokens' => {
+ model_id: '.elser_model_2',
+ model_text: 'How is the weather in Jamaica?',
+ pruning_config: {
+ tokens_freq_ratio_threshold: 5,
+ tokens_weight_threshold: 0.4,
+ only_score_pruned_tokens: true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/e9f9e184499a793828233e536fac0487.asciidoc b/docs/examples/guide/e9f9e184499a793828233e536fac0487.asciidoc
index 784bccba50..42f4734bc8 100644
--- a/docs/examples/guide/e9f9e184499a793828233e536fac0487.asciidoc
+++ b/docs/examples/guide/e9f9e184499a793828233e536fac0487.asciidoc
@@ -6,7 +6,7 @@ response = client.delete_by_query(
body: {
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/e9fe3b53b5b6e1ff9566b5237c0fa513.asciidoc b/docs/examples/guide/e9fe3b53b5b6e1ff9566b5237c0fa513.asciidoc
new file mode 100644
index 0000000000..f23e07bfc5
--- /dev/null
+++ b/docs/examples/guide/e9fe3b53b5b6e1ff9566b5237c0fa513.asciidoc
@@ -0,0 +1,43 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'child_example',
+ id: 2,
+ routing: 1,
+ body: {
+ join: {
+ name: 'answer',
+ parent: '1'
+ },
+ owner: {
+ location: 'Norfolk, United Kingdom',
+ display_name: 'Sam',
+ id: 48
+ },
+ body: "Unfortunately you're pretty much limited to FTP...",
+ creation_date: '2009-05-04T13:45:37.030'
+ }
+)
+puts response
+
+response = client.index(
+ index: 'child_example',
+ id: 3,
+ routing: 1,
+ refresh: true,
+ body: {
+ join: {
+ name: 'answer',
+ parent: '1'
+ },
+ owner: {
+ location: 'Norfolk, United Kingdom',
+ display_name: 'Troll',
+ id: 49
+ },
+ body: 'Use Linux...',
+ creation_date: '2009-05-05T13:45:37.030'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/ea020ea32d5cd35e577c61a120f92451.asciidoc b/docs/examples/guide/ea020ea32d5cd35e577c61a120f92451.asciidoc
new file mode 100644
index 0000000000..0272c02798
--- /dev/null
+++ b/docs/examples/guide/ea020ea32d5cd35e577c61a120f92451.asciidoc
@@ -0,0 +1,32 @@
+[source, ruby]
+----
+response = client.bulk(
+ index: 'my-data-stream',
+ body: [
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2099-05-06T16:21:15.000Z',
+ message: '192.0.2.42 - - [06/May/2099:16:21:15 +0000] "GET /images/bg.jpg HTTP/1.0" 200 24736'
+ },
+ {
+ create: {}
+ },
+ {
+ "@timestamp": '2099-05-06T16:25:42.000Z',
+ message: '192.0.2.255 - - [06/May/2099:16:25:42 +0000] "GET /favicon.ico HTTP/1.0" 200 3638'
+ }
+ ]
+)
+puts response
+
+response = client.index(
+ index: 'my-data-stream',
+ body: {
+ "@timestamp": '2099-05-06T16:21:15.000Z',
+ message: '192.0.2.42 - - [06/May/2099:16:21:15 +0000] "GET /images/bg.jpg HTTP/1.0" 200 24736'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/ea0a5762f297928ea79948250a3624ed.asciidoc b/docs/examples/guide/ea0a5762f297928ea79948250a3624ed.asciidoc
new file mode 100644
index 0000000000..e3214cc744
--- /dev/null
+++ b/docs/examples/guide/ea0a5762f297928ea79948250a3624ed.asciidoc
@@ -0,0 +1,53 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'mv',
+ body: {
+ mappings: {
+ properties: {
+ b: {
+ type: 'long'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.bulk(
+ index: 'mv',
+ refresh: true,
+ body: [
+ {
+ index: {}
+ },
+ {
+ a: 1,
+ b: [
+ 2,
+ 2,
+ 1
+ ]
+ },
+ {
+ index: {}
+ },
+ {
+ a: 2,
+ b: [
+ 1,
+ 1
+ ]
+ }
+ ]
+)
+puts response
+
+response = client.esql.query(
+ body: {
+ query: 'FROM mv | LIMIT 2',
+ version: '2024.04.01'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/ea5b4d2d87fd4e040afad18903c44869.asciidoc b/docs/examples/guide/ea5b4d2d87fd4e040afad18903c44869.asciidoc
index f2a7b0aa61..539183aca3 100644
--- a/docs/examples/guide/ea5b4d2d87fd4e040afad18903c44869.asciidoc
+++ b/docs/examples/guide/ea5b4d2d87fd4e040afad18903c44869.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
},
filter: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
top_left: {
lat: 40.73,
lon: -74.1
diff --git a/docs/examples/guide/eada8af6588584ac88f1e5b15f4a5c2a.asciidoc b/docs/examples/guide/eada8af6588584ac88f1e5b15f4a5c2a.asciidoc
index 58225bddb1..4676c691d0 100644
--- a/docs/examples/guide/eada8af6588584ac88f1e5b15f4a5c2a.asciidoc
+++ b/docs/examples/guide/eada8af6588584ac88f1e5b15f4a5c2a.asciidoc
@@ -4,7 +4,7 @@ response = client.index(
index: 'metrics_index',
id: 1,
body: {
- "network.name": 'net-1',
+ 'network.name' => 'net-1',
latency_histo: {
values: [
0.1,
@@ -29,7 +29,7 @@ response = client.index(
index: 'metrics_index',
id: 2,
body: {
- "network.name": 'net-2',
+ 'network.name' => 'net-2',
latency_histo: {
values: [
0.1,
diff --git a/docs/examples/guide/eae8931d01b3b878dd0c45214121e662.asciidoc b/docs/examples/guide/eae8931d01b3b878dd0c45214121e662.asciidoc
index 59b9d4be99..f4205e60b5 100644
--- a/docs/examples/guide/eae8931d01b3b878dd0c45214121e662.asciidoc
+++ b/docs/examples/guide/eae8931d01b3b878dd0c45214121e662.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
top_left: 'dr',
bottom_right: 'dr'
}
diff --git a/docs/examples/guide/eaf6a846ded090fd6ac48269ad2b328b.asciidoc b/docs/examples/guide/eaf6a846ded090fd6ac48269ad2b328b.asciidoc
index 9d9c63282c..3ad6059478 100644
--- a/docs/examples/guide/eaf6a846ded090fd6ac48269ad2b328b.asciidoc
+++ b/docs/examples/guide/eaf6a846ded090fd6ac48269ad2b328b.asciidoc
@@ -4,8 +4,8 @@ response = client.indices.create(
index: 'my-index-000001',
body: {
settings: {
- "index.lifecycle.name": 'my_policy',
- "index.lifecycle.rollover_alias": 'my_data'
+ 'index.lifecycle.name' => 'my_policy',
+ 'index.lifecycle.rollover_alias' => 'my_data'
},
aliases: {
my_data: {
diff --git a/docs/examples/guide/ec8f176ebf436d5719bdeca4a9ea8220.asciidoc b/docs/examples/guide/ec8f176ebf436d5719bdeca4a9ea8220.asciidoc
index 9667d8df43..5879a26fe4 100644
--- a/docs/examples/guide/ec8f176ebf436d5719bdeca4a9ea8220.asciidoc
+++ b/docs/examples/guide/ec8f176ebf436d5719bdeca4a9ea8220.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
index: 'products',
body: {
runtime_mappings: {
- "genre.length": {
+ 'genre.length' => {
type: 'long',
script: "emit(doc['genre'].value.length())"
}
diff --git a/docs/examples/guide/ecfd0d94dd14ef05dfa861f22544b388.asciidoc b/docs/examples/guide/ecfd0d94dd14ef05dfa861f22544b388.asciidoc
new file mode 100644
index 0000000000..cb49956e46
--- /dev/null
+++ b/docs/examples/guide/ecfd0d94dd14ef05dfa861f22544b388.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.connector.update_error(
+ connector_id: 'my-connector',
+ body: {
+ error: 'Houston, we have a problem!'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/ed27843eff311f3011b679e97e6fda50.asciidoc b/docs/examples/guide/ed27843eff311f3011b679e97e6fda50.asciidoc
index a8d4cfeed9..d6a5dfbef3 100644
--- a/docs/examples/guide/ed27843eff311f3011b679e97e6fda50.asciidoc
+++ b/docs/examples/guide/ed27843eff311f3011b679e97e6fda50.asciidoc
@@ -6,7 +6,7 @@ response = client.snapshot.restore(
body: {
indices: 'my-index,logs-my_app-default',
index_settings: {
- "index.number_of_replicas": 1
+ 'index.number_of_replicas' => 1
}
}
)
diff --git a/docs/examples/guide/ed5c3b45e8de912faba44507d827eb93.asciidoc b/docs/examples/guide/ed5c3b45e8de912faba44507d827eb93.asciidoc
index 7d011217ed..9e142c5eed 100644
--- a/docs/examples/guide/ed5c3b45e8de912faba44507d827eb93.asciidoc
+++ b/docs/examples/guide/ed5c3b45e8de912faba44507d827eb93.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
sort: [
{
_geo_distance: {
- "pin.location": 'POINT (-70 40)',
+ 'pin.location' => 'POINT (-70 40)',
order: 'asc',
unit: 'km'
}
diff --git a/docs/examples/guide/ed688d86eeaa4d7969acb0f574eb917f.asciidoc b/docs/examples/guide/ed688d86eeaa4d7969acb0f574eb917f.asciidoc
index f94c422b2f..54461f57f8 100644
--- a/docs/examples/guide/ed688d86eeaa4d7969acb0f574eb917f.asciidoc
+++ b/docs/examples/guide/ed688d86eeaa4d7969acb0f574eb917f.asciidoc
@@ -7,7 +7,7 @@ response = client.index(
body: {
query: {
term: {
- "my_field.prefix": 'abc'
+ 'my_field.prefix' => 'abc'
}
}
}
diff --git a/docs/examples/guide/edae616e1244babf6032aecc6aaaf836.asciidoc b/docs/examples/guide/edae616e1244babf6032aecc6aaaf836.asciidoc
index 9ce770113e..5deea04c70 100644
--- a/docs/examples/guide/edae616e1244babf6032aecc6aaaf836.asciidoc
+++ b/docs/examples/guide/edae616e1244babf6032aecc6aaaf836.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
sort: [
{
_geo_distance: {
- "pin.location": {
+ 'pin.location' => {
lat: 40,
lon: -70
},
diff --git a/docs/examples/guide/ee0fd67acc807f1bddf5e9807c06e7eb.asciidoc b/docs/examples/guide/ee0fd67acc807f1bddf5e9807c06e7eb.asciidoc
new file mode 100644
index 0000000000..45cfc002e9
--- /dev/null
+++ b/docs/examples/guide/ee0fd67acc807f1bddf5e9807c06e7eb.asciidoc
@@ -0,0 +1,94 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ query: {
+ weighted_tokens: {
+ query_expansion_field: {
+ tokens: {
+ "2161": 0.4679,
+ "2621": 0.307,
+ "2782": 0.1299,
+ "2851": 0.1056,
+ "3088": 0.3041,
+ "3376": 0.1038,
+ "3467": 0.4873,
+ "3684": 0.8958,
+ "4380": 0.334,
+ "4542": 0.4636,
+ "4633": 2.2805,
+ "4785": 1.2628,
+ "4860": 1.0655,
+ "5133": 1.0709,
+ "7139": 1.0016,
+ "7224": 0.2486,
+ "7387": 0.0985,
+ "7394": 0.0542,
+ "8915": 0.369,
+ "9156": 2.8947,
+ "10505": 0.2771,
+ "11464": 0.3996,
+ "13525": 0.0088,
+ "14178": 0.8161,
+ "16893": 0.1376,
+ "17851": 1.5348,
+ "19939": 0.6012
+ },
+ pruning_config: {
+ tokens_freq_ratio_threshold: 5,
+ tokens_weight_threshold: 0.4,
+ only_score_pruned_tokens: false
+ }
+ }
+ }
+ },
+ rescore: {
+ window_size: 100,
+ query: {
+ rescore_query: {
+ weighted_tokens: {
+ query_expansion_field: {
+ tokens: {
+ "2161": 0.4679,
+ "2621": 0.307,
+ "2782": 0.1299,
+ "2851": 0.1056,
+ "3088": 0.3041,
+ "3376": 0.1038,
+ "3467": 0.4873,
+ "3684": 0.8958,
+ "4380": 0.334,
+ "4542": 0.4636,
+ "4633": 2.2805,
+ "4785": 1.2628,
+ "4860": 1.0655,
+ "5133": 1.0709,
+ "7139": 1.0016,
+ "7224": 0.2486,
+ "7387": 0.0985,
+ "7394": 0.0542,
+ "8915": 0.369,
+ "9156": 2.8947,
+ "10505": 0.2771,
+ "11464": 0.3996,
+ "13525": 0.0088,
+ "14178": 0.8161,
+ "16893": 0.1376,
+ "17851": 1.5348,
+ "19939": 0.6012
+ },
+ pruning_config: {
+ tokens_freq_ratio_threshold: 5,
+ tokens_weight_threshold: 0.4,
+ only_score_pruned_tokens: true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/eec051555c8050d017d3fe38ea59e3a0.asciidoc b/docs/examples/guide/eec051555c8050d017d3fe38ea59e3a0.asciidoc
index 949429f35a..af7b7ab1fd 100644
--- a/docs/examples/guide/eec051555c8050d017d3fe38ea59e3a0.asciidoc
+++ b/docs/examples/guide/eec051555c8050d017d3fe38ea59e3a0.asciidoc
@@ -7,7 +7,7 @@ response = client.search(
body: {
query: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
}
}
diff --git a/docs/examples/guide/ef779b87b3b0fb6e6bae9c8875e3a1cf.asciidoc b/docs/examples/guide/ef779b87b3b0fb6e6bae9c8875e3a1cf.asciidoc
index 0726354399..9772ac2d70 100644
--- a/docs/examples/guide/ef779b87b3b0fb6e6bae9c8875e3a1cf.asciidoc
+++ b/docs/examples/guide/ef779b87b3b0fb6e6bae9c8875e3a1cf.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
size: 0,
body: {
runtime_mappings: {
- "date.promoted_is_tomorrow": {
+ 'date.promoted_is_tomorrow' => {
type: 'date',
script: "\n long date = doc['date'].value.toInstant().toEpochMilli();\n if (doc['promoted'].value) {\n date += 86400;\n }\n emit(date);\n "
}
diff --git a/docs/examples/guide/eff8ecaed1ed084909c64450fc363a20.asciidoc b/docs/examples/guide/eff8ecaed1ed084909c64450fc363a20.asciidoc
index 2fa0dd9338..c94a451c56 100644
--- a/docs/examples/guide/eff8ecaed1ed084909c64450fc363a20.asciidoc
+++ b/docs/examples/guide/eff8ecaed1ed084909c64450fc363a20.asciidoc
@@ -3,7 +3,7 @@
response = client.cluster.put_settings(
body: {
transient: {
- "indices.recovery.max_bytes_per_sec": nil
+ 'indices.recovery.max_bytes_per_sec' => nil
}
}
)
diff --git a/docs/examples/guide/f01d9bbab5b4535b9e067cde3f64ddbf.asciidoc b/docs/examples/guide/f01d9bbab5b4535b9e067cde3f64ddbf.asciidoc
deleted file mode 100644
index 7142a063e6..0000000000
--- a/docs/examples/guide/f01d9bbab5b4535b9e067cde3f64ddbf.asciidoc
+++ /dev/null
@@ -1,13 +0,0 @@
-[source, ruby]
-----
-response = client.cluster.allocation_explain(
- filter_path: 'index,node_allocation_decisions.node_name,node_allocation_decisions.deciders.*',
- body: {
- index: 'my-index',
- shard: 0,
- primary: false,
- current_node: 'my-node'
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/f0bfc8d7ab4eb94ea5fdf2e087d8cf5b.asciidoc b/docs/examples/guide/f0bfc8d7ab4eb94ea5fdf2e087d8cf5b.asciidoc
index fb8f3858ae..8f6f3a714e 100644
--- a/docs/examples/guide/f0bfc8d7ab4eb94ea5fdf2e087d8cf5b.asciidoc
+++ b/docs/examples/guide/f0bfc8d7ab4eb94ea5fdf2e087d8cf5b.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
size: 0,
runtime_mappings: {
- "load_time.seconds": {
+ 'load_time.seconds' => {
type: 'long',
script: {
source: "emit(doc['load_time'].value / params.timeUnit)",
diff --git a/docs/examples/guide/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc b/docs/examples/guide/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc
new file mode 100644
index 0000000000..b86bb8e691
--- /dev/null
+++ b/docs/examples/guide/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc
@@ -0,0 +1,20 @@
+[source, ruby]
+----
+response = client.inference.inference(
+ task_type: 'rerank',
+ inference_id: 'cohere_rerank',
+ body: {
+ input: [
+ 'luke',
+ 'like',
+ 'leia',
+ 'chewy',
+ 'r2d2',
+ 'star',
+ 'wars'
+ ],
+ query: 'star wars main character'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f1dc6f69453867ffafe86e998dd464d9.asciidoc b/docs/examples/guide/f1dc6f69453867ffafe86e998dd464d9.asciidoc
index 2327c2afcc..bee9cbda7a 100644
--- a/docs/examples/guide/f1dc6f69453867ffafe86e998dd464d9.asciidoc
+++ b/docs/examples/guide/f1dc6f69453867ffafe86e998dd464d9.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
body: {
query: {
term: {
- "file_path.tree_reversed": {
+ 'file_path.tree_reversed' => {
value: 'my_photo1.jpg'
}
}
diff --git a/docs/examples/guide/f29b8edba5eabb0b05a4f74d9ae6a816.asciidoc b/docs/examples/guide/f29b8edba5eabb0b05a4f74d9ae6a816.asciidoc
deleted file mode 100644
index 038a8e7611..0000000000
--- a/docs/examples/guide/f29b8edba5eabb0b05a4f74d9ae6a816.asciidoc
+++ /dev/null
@@ -1,19 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'my-index-2',
- body: {
- mappings: {
- properties: {
- my_vector: {
- type: 'dense_vector',
- dims: 3,
- index: true,
- similarity: 'dot_product'
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc b/docs/examples/guide/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc
new file mode 100644
index 0000000000..a4b6902fbe
--- /dev/null
+++ b/docs/examples/guide/f2a5f77f929cc7b893b80f4bd5b1a192.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.get(
+ connector_id: 'my-connector'
+)
+puts response
+----
diff --git a/docs/examples/guide/f2da3937e5f0718527e6eb73aa261b1f.asciidoc b/docs/examples/guide/f2da3937e5f0718527e6eb73aa261b1f.asciidoc
new file mode 100644
index 0000000000..89faf9ab29
--- /dev/null
+++ b/docs/examples/guide/f2da3937e5f0718527e6eb73aa261b1f.asciidoc
@@ -0,0 +1,53 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'mv',
+ body: {
+ mappings: {
+ properties: {
+ b: {
+ type: 'long'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.bulk(
+ index: 'mv',
+ refresh: true,
+ body: [
+ {
+ index: {}
+ },
+ {
+ a: 1,
+ b: [
+ 2,
+ 2,
+ 1
+ ]
+ },
+ {
+ index: {}
+ },
+ {
+ a: 2,
+ b: [
+ 1,
+ 1
+ ]
+ }
+ ]
+)
+puts response
+
+response = client.esql.query(
+ body: {
+ query: 'FROM mv | EVAL b=TO_STRING(b) | LIMIT 2',
+ version: '2024.04.01'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f2f1cae094855a45fd8f73478bec8e70.asciidoc b/docs/examples/guide/f2f1cae094855a45fd8f73478bec8e70.asciidoc
index ade2dc038c..89a0e615a0 100644
--- a/docs/examples/guide/f2f1cae094855a45fd8f73478bec8e70.asciidoc
+++ b/docs/examples/guide/f2f1cae094855a45fd8f73478bec8e70.asciidoc
@@ -5,7 +5,7 @@ response = client.indices.split(
target: 'my_target_index',
body: {
settings: {
- "index.number_of_shards": 5
+ 'index.number_of_shards' => 5
},
aliases: {
my_search_indices: {}
diff --git a/docs/examples/guide/f3594de7ef39ab09b0bb12c1e76bfe6b.asciidoc b/docs/examples/guide/f3594de7ef39ab09b0bb12c1e76bfe6b.asciidoc
index 930f69aee4..48e2320a07 100644
--- a/docs/examples/guide/f3594de7ef39ab09b0bb12c1e76bfe6b.asciidoc
+++ b/docs/examples/guide/f3594de7ef39ab09b0bb12c1e76bfe6b.asciidoc
@@ -5,8 +5,8 @@ response = client.indices.shrink(
target: 'my_target_index',
body: {
settings: {
- "index.routing.allocation.require._name": nil,
- "index.blocks.write": nil
+ 'index.routing.allocation.require._name' => nil,
+ 'index.blocks.write' => nil
}
}
)
diff --git a/docs/examples/guide/f38262ef72f73816ec35fa4c9c85760d.asciidoc b/docs/examples/guide/f38262ef72f73816ec35fa4c9c85760d.asciidoc
new file mode 100644
index 0000000000..c219238128
--- /dev/null
+++ b/docs/examples/guide/f38262ef72f73816ec35fa4c9c85760d.asciidoc
@@ -0,0 +1,45 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'idx',
+ body: {
+ mappings: {
+ _source: {
+ mode: 'synthetic'
+ },
+ properties: {
+ my_range: {
+ type: 'long_range'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'idx',
+ id: 1,
+ body: {
+ my_range: [
+ {
+ gte: 200,
+ lte: 300
+ },
+ {
+ gte: 1,
+ lte: 100
+ },
+ {
+ gte: 200,
+ lte: 300
+ },
+ {
+ gte: 200,
+ lte: 500
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f495f9c99916a05e3b28166d31955fad.asciidoc b/docs/examples/guide/f495f9c99916a05e3b28166d31955fad.asciidoc
index 0131bd7c19..5be84ab8b9 100644
--- a/docs/examples/guide/f495f9c99916a05e3b28166d31955fad.asciidoc
+++ b/docs/examples/guide/f495f9c99916a05e3b28166d31955fad.asciidoc
@@ -7,7 +7,7 @@ response = client.search(
terms: {
field: 'genre',
order: {
- "playback_stats.max": 'desc'
+ 'playback_stats.max' => 'desc'
}
},
aggregations: {
diff --git a/docs/examples/guide/f49ac80f0130cae8d0ea6f4472a149dd.asciidoc b/docs/examples/guide/f49ac80f0130cae8d0ea6f4472a149dd.asciidoc
new file mode 100644
index 0000000000..003a91cb15
--- /dev/null
+++ b/docs/examples/guide/f49ac80f0130cae8d0ea6f4472a149dd.asciidoc
@@ -0,0 +1,25 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-image-index',
+ body: {
+ mappings: {
+ properties: {
+ "image-vector": {
+ type: 'dense_vector',
+ dims: 3,
+ index: true,
+ similarity: 'l2_norm'
+ },
+ "file-type": {
+ type: 'keyword'
+ },
+ title: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f4ae3f3fbf07a7d39122ac5ac20b9c03.asciidoc b/docs/examples/guide/f4ae3f3fbf07a7d39122ac5ac20b9c03.asciidoc
new file mode 100644
index 0000000000..86ec87cc05
--- /dev/null
+++ b/docs/examples/guide/f4ae3f3fbf07a7d39122ac5ac20b9c03.asciidoc
@@ -0,0 +1,25 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'quantized-image-index',
+ body: {
+ mappings: {
+ properties: {
+ "image-vector": {
+ type: 'dense_vector',
+ element_type: 'float',
+ dims: 2,
+ index: true,
+ index_options: {
+ type: 'int8_hnsw'
+ }
+ },
+ title: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f4dc1286d0a2f8d1fde64fbf12fd9f8d.asciidoc b/docs/examples/guide/f4dc1286d0a2f8d1fde64fbf12fd9f8d.asciidoc
index 19ce104e1d..60df29c193 100644
--- a/docs/examples/guide/f4dc1286d0a2f8d1fde64fbf12fd9f8d.asciidoc
+++ b/docs/examples/guide/f4dc1286d0a2f8d1fde64fbf12fd9f8d.asciidoc
@@ -3,14 +3,14 @@
response = client.cluster.put_settings(
body: {
persistent: {
- "cluster.routing.allocation.disk.watermark.low": nil,
- "cluster.routing.allocation.disk.watermark.low.max_headroom": nil,
- "cluster.routing.allocation.disk.watermark.high": nil,
- "cluster.routing.allocation.disk.watermark.high.max_headroom": nil,
- "cluster.routing.allocation.disk.watermark.flood_stage": nil,
- "cluster.routing.allocation.disk.watermark.flood_stage.max_headroom": nil,
- "cluster.routing.allocation.disk.watermark.flood_stage.frozen": nil,
- "cluster.routing.allocation.disk.watermark.flood_stage.frozen.max_headroom": nil
+ 'cluster.routing.allocation.disk.watermark.low' => nil,
+ 'cluster.routing.allocation.disk.watermark.low.max_headroom' => nil,
+ 'cluster.routing.allocation.disk.watermark.high' => nil,
+ 'cluster.routing.allocation.disk.watermark.high.max_headroom' => nil,
+ 'cluster.routing.allocation.disk.watermark.flood_stage' => nil,
+ 'cluster.routing.allocation.disk.watermark.flood_stage.max_headroom' => nil,
+ 'cluster.routing.allocation.disk.watermark.flood_stage.frozen' => nil,
+ 'cluster.routing.allocation.disk.watermark.flood_stage.frozen.max_headroom' => nil
}
}
)
diff --git a/docs/examples/guide/f4e38856cd6a7531e8fa8df4abe0e1c4.asciidoc b/docs/examples/guide/f4e38856cd6a7531e8fa8df4abe0e1c4.asciidoc
new file mode 100644
index 0000000000..89ee8479d4
--- /dev/null
+++ b/docs/examples/guide/f4e38856cd6a7531e8fa8df4abe0e1c4.asciidoc
@@ -0,0 +1,17 @@
+[source, ruby]
+----
+response = client.search(
+ index: 'my-index',
+ body: {
+ query: {
+ text_expansion: {
+ content_embedding: {
+ model_id: '.elser_model_2',
+ model_text: 'How to avoid muscle soreness after running?'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f55cfbfc93d25941fa1d28866e050902.asciidoc b/docs/examples/guide/f55cfbfc93d25941fa1d28866e050902.asciidoc
deleted file mode 100644
index 8b639aa9ad..0000000000
--- a/docs/examples/guide/f55cfbfc93d25941fa1d28866e050902.asciidoc
+++ /dev/null
@@ -1,153 +0,0 @@
-[source, ruby]
-----
-response = client.indices.create(
- index: 'sample-01',
- body: {
- settings: {
- index: {
- mode: 'time_series',
- time_series: {
- start_time: '2022-06-10T00:00:00Z',
- end_time: '2022-06-30T23:59:59Z'
- },
- routing_path: [
- 'kubernetes.namespace',
- 'kubernetes.host',
- 'kubernetes.node',
- 'kubernetes.pod'
- ],
- number_of_replicas: 0,
- number_of_shards: 2
- }
- },
- mappings: {
- properties: {
- "@timestamp": {
- type: 'date'
- },
- kubernetes: {
- properties: {
- container: {
- properties: {
- cpu: {
- properties: {
- usage: {
- properties: {
- core: {
- properties: {
- ns: {
- type: 'long'
- }
- }
- },
- limit: {
- properties: {
- pct: {
- type: 'float'
- }
- }
- },
- nanocores: {
- type: 'long',
- time_series_metric: 'gauge'
- },
- node: {
- properties: {
- pct: {
- type: 'float'
- }
- }
- }
- }
- }
- }
- },
- memory: {
- properties: {
- available: {
- properties: {
- bytes: {
- type: 'long',
- time_series_metric: 'gauge'
- }
- }
- },
- majorpagefaults: {
- type: 'long'
- },
- pagefaults: {
- type: 'long',
- time_series_metric: 'gauge'
- },
- rss: {
- properties: {
- bytes: {
- type: 'long',
- time_series_metric: 'gauge'
- }
- }
- },
- usage: {
- properties: {
- bytes: {
- type: 'long',
- time_series_metric: 'gauge'
- },
- limit: {
- properties: {
- pct: {
- type: 'float'
- }
- }
- },
- node: {
- properties: {
- pct: {
- type: 'float'
- }
- }
- }
- }
- },
- workingset: {
- properties: {
- bytes: {
- type: 'long',
- time_series_metric: 'gauge'
- }
- }
- }
- }
- },
- name: {
- type: 'keyword'
- },
- start_time: {
- type: 'date'
- }
- }
- },
- host: {
- type: 'keyword',
- time_series_dimension: true
- },
- namespace: {
- type: 'keyword',
- time_series_dimension: true
- },
- node: {
- type: 'keyword',
- time_series_dimension: true
- },
- pod: {
- type: 'keyword',
- time_series_dimension: true
- }
- }
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/f58969ac405db85f439c5940d014964b.asciidoc b/docs/examples/guide/f58969ac405db85f439c5940d014964b.asciidoc
index d7c2e9884c..ee94af29bf 100644
--- a/docs/examples/guide/f58969ac405db85f439c5940d014964b.asciidoc
+++ b/docs/examples/guide/f58969ac405db85f439c5940d014964b.asciidoc
@@ -10,7 +10,7 @@ response = client.search(
},
filter: {
geo_bounding_box: {
- "pin.location": {
+ 'pin.location' => {
wkt: 'BBOX (-74.1, -71.12, 40.73, 40.01)'
}
}
diff --git a/docs/examples/guide/f589cb2b789b4a16ed78183f2349a735.asciidoc b/docs/examples/guide/f589cb2b789b4a16ed78183f2349a735.asciidoc
deleted file mode 100644
index f6e259cf0f..0000000000
--- a/docs/examples/guide/f589cb2b789b4a16ed78183f2349a735.asciidoc
+++ /dev/null
@@ -1,68 +0,0 @@
-[source, ruby]
-----
-response = client.index(
- index: 'metrics_index',
- id: 1,
- body: {
- "network.name": 'net-1',
- latency_histo: {
- values: [
- 1,
- 3,
- 8,
- 12,
- 15
- ],
- counts: [
- 3,
- 7,
- 23,
- 12,
- 6
- ]
- }
- }
-)
-puts response
-
-response = client.index(
- index: 'metrics_index',
- id: 2,
- body: {
- "network.name": 'net-2',
- latency_histo: {
- values: [
- 1,
- 6,
- 8,
- 12,
- 14
- ],
- counts: [
- 8,
- 17,
- 8,
- 7,
- 6
- ]
- }
- }
-)
-puts response
-
-response = client.search(
- index: 'metrics_index',
- size: 0,
- body: {
- aggregations: {
- latency_buckets: {
- histogram: {
- field: 'latency_histo',
- interval: 5
- }
- }
- }
- }
-)
-puts response
-----
diff --git a/docs/examples/guide/f5cbbb60ca26867a5d2da625a68a6e65.asciidoc b/docs/examples/guide/f5cbbb60ca26867a5d2da625a68a6e65.asciidoc
index e47ed136d9..c236b7b5b2 100644
--- a/docs/examples/guide/f5cbbb60ca26867a5d2da625a68a6e65.asciidoc
+++ b/docs/examples/guide/f5cbbb60ca26867a5d2da625a68a6e65.asciidoc
@@ -5,7 +5,7 @@ response = client.indices.create(
body: {
mappings: {
properties: {
- "total_quantity.sum": {
+ 'total_quantity.sum' => {
type: 'double'
},
total_quantity: {
@@ -14,16 +14,16 @@ response = client.indices.create(
taxless_total_price: {
type: 'object'
},
- "taxless_total_price.sum": {
+ 'taxless_total_price.sum' => {
type: 'double'
},
- "order_id.cardinality": {
+ 'order_id.cardinality' => {
type: 'long'
},
customer_id: {
type: 'keyword'
},
- "total_quantity.max": {
+ 'total_quantity.max' => {
type: 'integer'
},
order_id: {
diff --git a/docs/examples/guide/f5eed3f2e3558a238487bc85305b7a71.asciidoc b/docs/examples/guide/f5eed3f2e3558a238487bc85305b7a71.asciidoc
new file mode 100644
index 0000000000..df847e9ade
--- /dev/null
+++ b/docs/examples/guide/f5eed3f2e3558a238487bc85305b7a71.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc b/docs/examples/guide/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc
new file mode 100644
index 0000000000..f2e52a81c5
--- /dev/null
+++ b/docs/examples/guide/f785b5d17eb59f8d2a353c2dee66eb5b.asciidoc
@@ -0,0 +1,7 @@
+[source, ruby]
+----
+response = client.connector.sync_job_get(
+ connector_sync_job_id: 'my-connector-sync-job'
+)
+puts response
+----
diff --git a/docs/examples/guide/f7d3d367a3d8e8ff0eca426b6ea85252.asciidoc b/docs/examples/guide/f7d3d367a3d8e8ff0eca426b6ea85252.asciidoc
new file mode 100644
index 0000000000..7d2efe648b
--- /dev/null
+++ b/docs/examples/guide/f7d3d367a3d8e8ff0eca426b6ea85252.asciidoc
@@ -0,0 +1,15 @@
+[source, ruby]
+----
+response = client.reindex(
+ body: {
+ source: {
+ index: 'k8s'
+ },
+ dest: {
+ index: 'k9s',
+ op_type: 'create'
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f8a0010753b1ff563dc42d703902d2fa.asciidoc b/docs/examples/guide/f8a0010753b1ff563dc42d703902d2fa.asciidoc
index 1f7a47ac05..dbb596c2ea 100644
--- a/docs/examples/guide/f8a0010753b1ff563dc42d703902d2fa.asciidoc
+++ b/docs/examples/guide/f8a0010753b1ff563dc42d703902d2fa.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
bool: {
must: {
term: {
- "user.id": 'kimchy'
+ 'user.id' => 'kimchy'
}
},
filter: {
diff --git a/docs/examples/guide/f98687271e1bec031cc34d05d8f4b60b.asciidoc b/docs/examples/guide/f98687271e1bec031cc34d05d8f4b60b.asciidoc
index 19583a02a5..1582fcda8a 100644
--- a/docs/examples/guide/f98687271e1bec031cc34d05d8f4b60b.asciidoc
+++ b/docs/examples/guide/f98687271e1bec031cc34d05d8f4b60b.asciidoc
@@ -6,7 +6,7 @@ response = client.search(
span_multi: {
match: {
prefix: {
- "user.id": {
+ 'user.id' => {
value: 'ki'
}
}
diff --git a/docs/examples/guide/f9a315ea99bed0cf2f36be1d74eb3e4a.asciidoc b/docs/examples/guide/f9a315ea99bed0cf2f36be1d74eb3e4a.asciidoc
new file mode 100644
index 0000000000..27b502a47b
--- /dev/null
+++ b/docs/examples/guide/f9a315ea99bed0cf2f36be1d74eb3e4a.asciidoc
@@ -0,0 +1,10 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: 'MULTIPOLYGON (((102.0 2.0, 103.0 2.0, 103.0 3.0, 102.0 3.0, 102.0 2.0)), ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0), (100.2 0.2, 100.8 0.2, 100.8 0.8, 100.2 0.8, 100.2 0.2)))'
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/f9cb2547ab04461a12bfd25a35be5f96.asciidoc b/docs/examples/guide/f9cb2547ab04461a12bfd25a35be5f96.asciidoc
new file mode 100644
index 0000000000..d4f57568c3
--- /dev/null
+++ b/docs/examples/guide/f9cb2547ab04461a12bfd25a35be5f96.asciidoc
@@ -0,0 +1,37 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'idx',
+ body: {
+ mappings: {
+ _source: {
+ mode: 'synthetic'
+ },
+ properties: {
+ my_range: {
+ type: 'date_range'
+ }
+ }
+ }
+ }
+)
+puts response
+
+response = client.index(
+ index: 'idx',
+ id: 1,
+ body: {
+ my_range: [
+ {
+ gte: 1_504_224_000_000,
+ lte: 1_504_569_600_000
+ },
+ {
+ gte: '2017-09-01',
+ lte: '2017-09-10'
+ }
+ ]
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/fb3505d976283fb7c7b9705a761e0dc2.asciidoc b/docs/examples/guide/fb3505d976283fb7c7b9705a761e0dc2.asciidoc
new file mode 100644
index 0000000000..b34a9e90c6
--- /dev/null
+++ b/docs/examples/guide/fb3505d976283fb7c7b9705a761e0dc2.asciidoc
@@ -0,0 +1,37 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'polygon',
+ orientation: 'clockwise',
+ coordinates: [
+ [
+ [
+ 1000,
+ 1000
+ ],
+ [
+ 1000,
+ 1001
+ ],
+ [
+ 1001,
+ 1001
+ ],
+ [
+ 1001,
+ 1000
+ ],
+ [
+ 1000,
+ 1000
+ ]
+ ]
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/fbb38243221c8fb311660616e3add9ce.asciidoc b/docs/examples/guide/fbb38243221c8fb311660616e3add9ce.asciidoc
index 3c44141223..5aacb82f9b 100644
--- a/docs/examples/guide/fbb38243221c8fb311660616e3add9ce.asciidoc
+++ b/docs/examples/guide/fbb38243221c8fb311660616e3add9ce.asciidoc
@@ -5,7 +5,7 @@ response = client.search(
sort: [
{
_geo_distance: {
- "pin.location": [
+ 'pin.location' => [
-70,
40
],
diff --git a/docs/examples/guide/fbc5ab85b908480bf944b55da0a43488.asciidoc b/docs/examples/guide/fbc5ab85b908480bf944b55da0a43488.asciidoc
index 40ba63b33a..82a6ad3ed4 100644
--- a/docs/examples/guide/fbc5ab85b908480bf944b55da0a43488.asciidoc
+++ b/docs/examples/guide/fbc5ab85b908480bf944b55da0a43488.asciidoc
@@ -4,7 +4,7 @@ response = client.search(
body: {
query: {
prefix: {
- "user.id": {
+ 'user.id' => {
value: 'ki'
}
}
diff --git a/docs/examples/guide/fbdad6620eb645f5f1f02e3673604d01.asciidoc b/docs/examples/guide/fbdad6620eb645f5f1f02e3673604d01.asciidoc
index 0aa76aa993..0e93f5ecf9 100644
--- a/docs/examples/guide/fbdad6620eb645f5f1f02e3673604d01.asciidoc
+++ b/docs/examples/guide/fbdad6620eb645f5f1f02e3673604d01.asciidoc
@@ -11,7 +11,7 @@ response = client.search(
filter: {
geo_distance: {
distance: '12km',
- "pin.location": 'drm3btev3e86'
+ 'pin.location' => 'drm3btev3e86'
}
}
}
diff --git a/docs/examples/guide/fc1907515f6a913884a9f86451e90ee8.asciidoc b/docs/examples/guide/fc1907515f6a913884a9f86451e90ee8.asciidoc
new file mode 100644
index 0000000000..2d3789baf4
--- /dev/null
+++ b/docs/examples/guide/fc1907515f6a913884a9f86451e90ee8.asciidoc
@@ -0,0 +1,24 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index',
+ body: {
+ mappings: {
+ _source: {
+ excludes: [
+ 'content_embedding'
+ ]
+ },
+ properties: {
+ content_embedding: {
+ type: 'sparse_vector'
+ },
+ content: {
+ type: 'text'
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/fc51fbc60b0e20aac83300a43ad90252.asciidoc b/docs/examples/guide/fc51fbc60b0e20aac83300a43ad90252.asciidoc
new file mode 100644
index 0000000000..d06eb139cc
--- /dev/null
+++ b/docs/examples/guide/fc51fbc60b0e20aac83300a43ad90252.asciidoc
@@ -0,0 +1,34 @@
+[source, ruby]
+----
+response = client.index(
+ index: 'example',
+ body: {
+ location: {
+ type: 'geometrycollection',
+ geometries: [
+ {
+ type: 'point',
+ coordinates: [
+ 1000,
+ 100
+ ]
+ },
+ {
+ type: 'linestring',
+ coordinates: [
+ [
+ 1001,
+ 100
+ ],
+ [
+ 1002,
+ 100
+ ]
+ ]
+ }
+ ]
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/fdada036a875d7995d5d7aba9c06361e.asciidoc b/docs/examples/guide/fdada036a875d7995d5d7aba9c06361e.asciidoc
new file mode 100644
index 0000000000..254c14a466
--- /dev/null
+++ b/docs/examples/guide/fdada036a875d7995d5d7aba9c06361e.asciidoc
@@ -0,0 +1,18 @@
+[source, ruby]
+----
+response = client.indices.create(
+ index: 'my-index-2',
+ body: {
+ mappings: {
+ properties: {
+ my_vector: {
+ type: 'dense_vector',
+ dims: 3,
+ index: false
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/fe208d94ec93eabf3bd06139fa70701e.asciidoc b/docs/examples/guide/fe208d94ec93eabf3bd06139fa70701e.asciidoc
new file mode 100644
index 0000000000..b55fd5df6b
--- /dev/null
+++ b/docs/examples/guide/fe208d94ec93eabf3bd06139fa70701e.asciidoc
@@ -0,0 +1,45 @@
+[source, ruby]
+----
+response = client.indices.put_index_template(
+ name: 'sensor-template',
+ body: {
+ index_patterns: [
+ 'sensor-*'
+ ],
+ data_stream: {},
+ template: {
+ lifecycle: {
+ downsampling: [
+ {
+ after: '1d',
+ fixed_interval: '1h'
+ }
+ ]
+ },
+ settings: {
+ 'index.mode' => 'time_series'
+ },
+ mappings: {
+ properties: {
+ node: {
+ type: 'keyword',
+ time_series_dimension: true
+ },
+ temperature: {
+ type: 'half_float',
+ time_series_metric: 'gauge'
+ },
+ voltage: {
+ type: 'half_float',
+ time_series_metric: 'gauge'
+ },
+ "@timestamp": {
+ type: 'date'
+ }
+ }
+ }
+ }
+ }
+)
+puts response
+----
diff --git a/docs/examples/guide/ff05842419968a2141bde0371ac2f6f4.asciidoc b/docs/examples/guide/ff05842419968a2141bde0371ac2f6f4.asciidoc
index db282b0b7f..ab78aab9e4 100644
--- a/docs/examples/guide/ff05842419968a2141bde0371ac2f6f4.asciidoc
+++ b/docs/examples/guide/ff05842419968a2141bde0371ac2f6f4.asciidoc
@@ -5,7 +5,7 @@ response = client.render_search_template(
source: {
query: {
match: {
- "user.group.emails": '{{#join}}emails{{/join}}'
+ 'user.group.emails' => '{{#join}}emails{{/join}}'
}
}
},
diff --git a/docs/getting-started.asciidoc b/docs/getting-started.asciidoc
deleted file mode 100644
index a4500847b4..0000000000
--- a/docs/getting-started.asciidoc
+++ /dev/null
@@ -1,141 +0,0 @@
-[[getting-started-ruby]]
-== Getting started
-
-This page guides you through the installation process of the Ruby client, shows
-you how to instantiate the client, and how to perform basic Elasticsearch
-operations with it.
-
-[discrete]
-=== Requirements
-
-A currently maintained version of Ruby (3.0+) or JRuby (9.3+).
-
-[discrete]
-=== Installation
-
-To install the latest version of the client, run the following command:
-
-[source,shell]
---------------------------
-gem install elasticsearch
---------------------------
-
-Refer to the <> page to learn more.
-
-
-[discrete]
-=== Connecting
-
-You can connect to the Elastic Cloud using an API key and the Elasticsearch
-endpoint.
-
-[source,rb]
-----
-client = Elasticsearch::Client.new(
- cloud_id: '',
- api_key: ''
-)
-----
-
-Your Elasticsearch endpoint can be found on the **My deployment** page of your
-deployment:
-
-image::images/es_endpoint.jpg[alt="Finding Elasticsearch endpoint",align="center"]
-
-You can generate an API key on the **Management** page under Security.
-
-image::images/create_api_key.png[alt="Create API key",align="center"]
-
-For other connection options, refer to the <> section.
-
-
-[discrete]
-=== Operations
-
-Time to use Elasticsearch! This section walks you through the basic, and most
-important, operations of Elasticsearch. For more operations and more advanced
-examples, refer to the <> page.
-
-
-[discrete]
-==== Creating an index
-
-This is how you create the `my_index` index:
-
-[source,rb]
-----
-client.indices.create(index: 'my_index')
-----
-
-
-[discrete]
-==== Indexing documents
-
-This is a simple way of indexing a document:
-
-[source,rb]
-----
-document = { name: 'elasticsearch-ruby' }
-response = client.index(index: 'my_index', body: document)
-# You can get the indexed document id with:
-response['_id']
-=> "PlgIDYkBWS9Ngdx5IMy-"
-id = response['_id']
-----
-
-
-[discrete]
-==== Getting documents
-
-You can get documents by using the following code:
-
-[source,rb]
-----
-client.get(index: 'my_index', id: id)
-----
-
-
-[discrete]
-==== Searching documents
-
-This is how you can create a single match query with the Ruby client:
-
-[source,rb]
-----
-client.search(index: 'my_index', body: { query: { match_all: {} } })
-----
-
-
-[discrete]
-==== Updating documents
-
-This is how you can update a document, for example to add a new field:
-
-[source,rb]
-----
-client.update(index: 'my_index', id: id, body: { doc: { language: 'Ruby' } })
-----
-
-
-[discrete]
-==== Deleting documents
-
-[source,rb]
-----
-client.delete(index: 'my_index', id: id)
-----
-
-
-[discrete]
-==== Deleting an index
-
-[source,rb]
-----
-client.indices.delete(index: 'my_index')
-----
-
-
-[discrete]
-== Further reading
-
-* Use <> for a more confortable experience with the APIs.
\ No newline at end of file
diff --git a/docs/helpers.asciidoc b/docs/helpers.asciidoc
deleted file mode 100644
index 9509cd8989..0000000000
--- a/docs/helpers.asciidoc
+++ /dev/null
@@ -1,162 +0,0 @@
-[[Helpers]]
-== Client Helpers
-
-The {es} Ruby client includes some useful helpers for a more comfortable experience with some APIs.
-
-[discrete]
-=== Bulk Helper
-
-The Bulk API in Elasticsearch allows you to perform multiple indexing or deletion operations through a single API call, resulting in reduced overhead and improved indexing speed. The actions are specified in the request body using a newline delimited JSON (NDJSON) structure. In the Elasticsearch Ruby client, the `bulk` method supports several data structures as a parameter. You can use the Bulk API in an idiomatic way without concerns about payload formatting. Refer to <> for more information.
-
-
-The BulkHelper provides a better developer experience when using the Bulk API. At its simplest, you can send it a collection of hashes in an array, and it will bulk ingest them into {es}.
-
-To use the BulkHelper, require it in your code:
-
-[source,ruby]
-----
-require 'elasticsearch/helpers/bulk_helper'
-----
-
-Instantiate a BulkHelper with a client, and an index:
-[source,ruby]
-----
-client = Elasticsearch::Client.new
-bulk_helper = Elasticsearch::Helpers::BulkHelper.new(client, index)
-----
-
-This helper works on the index you pass in during initialization, but you can change the index at any time in your code:
-
-[source,ruby]
-----
-bulk_helper.index = 'new_index'
-----
-
-If you want to index a collection of documents, use the `ingest` method:
-
-[source,ruby]
-----
-documents = [
- { name: 'document1', date: '2024-05-16' },
- { name: 'document2', date: '2023-12-19' },
- { name: 'document3', date: '2024-07-07' }
-]
-bulk_helper.ingest(documents)
-----
-
-If you're ingesting a large set of data and want to separate the documents into smaller pieces before sending them to {es}, use the `slice` parameter.
-
-[source,ruby]
-----
-bulk_helper.ingest(documents, { slice: 2 })
-----
-
-This way the data will be sent in two different bulk requests.
-
-You can also include the parameters you would send to the Bulk API either in the query parameters or in the request body. The method signature is `ingest(docs, params = {}, body = {}, &block)`. Additionally, the method can be called with a block, that will provide access to the response object received from calling the Bulk API and the documents sent in the request:
-
-[source,ruby]
-----
-helper.ingest(documents) { |_, docs| puts "Ingested #{docs.count} documents" }
-----
-
-You can update and delete documents with the BulkHelper too. To delete a set of documents, you can send an array of document ids:
-
-[source,ruby]
-----
-ids = ['shm0I4gB6LpJd9ljO9mY', 'sxm0I4gB6LpJd9ljO9mY', 'tBm0I4gB6LpJd9ljO9mY', 'tRm0I4gB6LpJd9ljO9mY', 'thm0I4gB6LpJd9ljO9mY', 'txm0I4gB6LpJd9ljO9mY', 'uBm0I4gB6LpJd9ljO9mY', 'uRm0I4gB6LpJd9ljO9mY', 'uhm0I4gB6LpJd9ljO9mY', 'uxm0I4gB6LpJd9ljO9mY']
-helper.delete(ids)
-----
-
-To update documents, you can send the array of documents with their respective ids:
-[source,ruby]
-----
-documents = [
- {name: 'updated name 1', id: 'AxkFJYgB6LpJd9ljOtr7'},
- {name: 'updated name 2', id: 'BBkFJYgB6LpJd9ljOtr7'}
-]
-helper.update(documents)
-----
-
-[discrete]
-==== Ingest a JSON file
-
-`BulkHelper` also provides a helper to ingest data straight from a JSON file. By giving a file path as an input, the helper will parse and ingest the documents in the file:
-
-[source,ruby]
-----
-file_path = './data.json'
-helper.ingest_json(file_path)
-----
-
-In cases where the array of data you want to ingest is not necessarily in the root of the JSON file, you can provide the keys to access the data, for example given the following JSON file:
-
-[source,json]
-----
-{
- "field": "value",
- "status": 200,
- "data": {
- "items": [
- {
- "name": "Item 1",
- (...)
- },
- {
- (...)
- ]
- }
-}
-----
-
-The following is an example of the Ruby code to ingest the documents in the JSON above:
-
-[source,ruby]
-----
-bulk_helper.ingest_json(file_path, { keys: ['data', 'items'] })
-----
-
-[discrete]
-=== Scroll Helper
-
-This helper provides an easy way to get results from a Scroll.
-
-To use the ScrollHelper, require it in your code:
-
-[source,ruby]
-----
-require 'elasticsearch/helpers/scroll_helper'
-----
-
-Instantiate a ScrollHelper with a client, an index, and a body (with the scroll API parameters) which will be used in every following scroll request:
-
-[source,ruby]
-----
-client = Elasticsearch::Client.new
-scroll_helper = Elasticsearch::Helpers::ScrollHelper.new(client, index, body)
-----
-
-There are two ways to get the results from a scroll using the helper.
-
-1. You can iterate over a scroll using the methods in `Enumerable` such as `each` and `map`:
-+
---
-[source,ruby]
-----
-scroll_helper.each do |item|
- puts item
-end
-----
---
-2. You can fetch results by page, with the `results` function:
-+
---
-[source,ruby]
-----
-my_documents = []
-while !(documents = scroll_helper.results).empty?
- my_documents << documents
-end
-scroll_helper.clear
-----
---
diff --git a/docs/index-custom-title-page.html b/docs/index-custom-title-page.html
index e50a0351b4..e1f913c13e 100644
--- a/docs/index-custom-title-page.html
+++ b/docs/index-custom-title-page.html
@@ -153,7 +153,7 @@