Skip to content

Commit

Permalink
Auto-generated code for main (#2384)
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 28, 2024
1 parent 20ac2a6 commit a7123f8
Show file tree
Hide file tree
Showing 93 changed files with 2,023 additions and 438 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
kwd: {
type: "keyword",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

[source, js]
----
const response = await client.cluster.reroute({
metric: "none",
});
const response = await client.cluster.reroute();
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const response = await client.esql.asyncQuery({
body: {
query:
"\n FROM my-index-000001,cluster_one:my-index-000001,cluster_two:my-index*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ",
include_ccs_metadata: true,
},
});
console.log(response);
Expand Down
18 changes: 18 additions & 0 deletions docs/doc_examples/0c8be7aec84ea86b243904f5d4162f5a.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.search({
index: "cooking_blog",
query: {
match: {
title: {
query: "fluffy pancakes breakfast",
minimum_should_match: 2,
},
},
},
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const response = await client.connector.put({
name: "My Connector",
description: "My Connector to sync data to Elastic index from Google Drive",
service_type: "google_drive",
language: "english",
language: "en",
});
console.log(response);
----
21 changes: 21 additions & 0 deletions docs/doc_examples/0e31b8ad176b31028becf9500989bcbd.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.inference.put({
task_type: "text_embedding",
inference_id: "watsonx-embeddings",
inference_config: {
service: "watsonxai",
service_settings: {
api_key: "<api_key>",
url: "<url>",
model_id: "ibm/slate-30m-english-rtrvr",
project_id: "<project_id>",
api_version: "2024-03-14",
},
},
});
console.log(response);
----
55 changes: 55 additions & 0 deletions docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.search({
index: "cooking_blog",
query: {
bool: {
must: [
{
term: {
"category.keyword": "Main Course",
},
},
{
term: {
tags: "vegetarian",
},
},
{
range: {
rating: {
gte: 4.5,
},
},
},
],
should: [
{
multi_match: {
query: "curry spicy",
fields: ["title^2", "description"],
},
},
{
range: {
date: {
gte: "now-1M/d",
},
},
},
],
must_not: [
{
term: {
"category.keyword": "Dessert",
},
},
],
},
},
});
console.log(response);
----
19 changes: 19 additions & 0 deletions docs/doc_examples/1a7483796087053ba55029d0dc2ab356.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.index({
index: "mv",
refresh: "true",
document: {
a: [2, null, 1],
},
});
console.log(response);
const response1 = await client.esql.query({
query: "FROM mv | LIMIT 1",
});
console.log(response1);
----
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
card: {
type: "wildcard",
Expand Down
77 changes: 77 additions & 0 deletions docs/doc_examples/2c079d1ae4819a0c206b9e1aa5623523.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.indices.create({
index: "my-index-000001",
mappings: {
properties: {
attributes: {
type: "passthrough",
priority: 10,
properties: {
id: {
type: "keyword",
},
},
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "my-index-000001",
id: 1,
document: {
attributes: {
id: "foo",
zone: 10,
},
},
});
console.log(response1);
const response2 = await client.search({
index: "my-index-000001",
query: {
bool: {
must: [
{
match: {
id: "foo",
},
},
{
match: {
zone: 10,
},
},
],
},
},
});
console.log(response2);
const response3 = await client.search({
index: "my-index-000001",
query: {
bool: {
must: [
{
match: {
"attributes.id": "foo",
},
},
{
match: {
"attributes.zone": 10,
},
},
],
},
},
});
console.log(response3);
----
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const response = await client.indices.create({
"arabic_normalization",
"persian_normalization",
"persian_stop",
"persian_stem",
],
},
},
Expand Down
16 changes: 16 additions & 0 deletions docs/doc_examples/40f287bf733420bbab134b74c7d0ea5d.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.index({
index: "amazon-reviews",
id: 1,
document: {
review_text:
"This product is lifechanging! I'm telling all my friends about it.",
review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
},
});
console.log(response);
----
14 changes: 14 additions & 0 deletions docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.inference.streamInference({
task_type: "completion",
inference_id: "openai-completion",
body: {
input: "What is Elastic?",
},
});
console.log(response);
----
32 changes: 32 additions & 0 deletions docs/doc_examples/55085e6a2891040b6ac696561d0787c8.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.indices.create({
index: "my-index-000002",
mappings: {
properties: {
attributes: {
type: "passthrough",
priority: 10,
properties: {
id: {
type: "keyword",
},
},
},
"resource.attributes": {
type: "passthrough",
priority: 20,
properties: {
id: {
type: "keyword",
},
},
},
},
},
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
agg_metric: {
type: "aggregate_metric_double",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
----
const response = await client.indices.create({
index: "idx",
mappings: {
_source: {
mode: "synthetic",
settings: {
index: {
mapping: {
source: {
mode: "synthetic",
},
},
},
},
mappings: {
properties: {
my_range: {
type: "long_range",
Expand Down
18 changes: 18 additions & 0 deletions docs/doc_examples/58dd26afc919722e21358c91e112b27a.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.search({
index: "cooking_blog",
query: {
range: {
date: {
gte: "2023-05-01",
lte: "2023-05-31",
},
},
},
});
console.log(response);
----
Loading

0 comments on commit a7123f8

Please sign in to comment.