Auto-generated code for 8.x (#2412)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
@ -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",
|
||||
@ -3,8 +3,6 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.cluster.reroute({
|
||||
metric: "none",
|
||||
});
|
||||
const response = await client.cluster.reroute();
|
||||
console.log(response);
|
||||
----
|
||||
@ -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);
|
||||
18
docs/doc_examples/0c8be7aec84ea86b243904f5d4162f5a.asciidoc
Normal file
18
docs/doc_examples/0c8be7aec84ea86b243904f5d4162f5a.asciidoc
Normal file
@ -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);
|
||||
----
|
||||
@ -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
docs/doc_examples/0e31b8ad176b31028becf9500989bcbd.asciidoc
Normal file
21
docs/doc_examples/0e31b8ad176b31028becf9500989bcbd.asciidoc
Normal file
@ -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
docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc
Normal file
55
docs/doc_examples/191074b2eebd5f74e628c2ada4b6d2e4.asciidoc
Normal file
@ -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
docs/doc_examples/1a7483796087053ba55029d0dc2ab356.asciidoc
Normal file
19
docs/doc_examples/1a7483796087053ba55029d0dc2ab356.asciidoc
Normal file
@ -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);
|
||||
----
|
||||
@ -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",
|
||||
77
docs/doc_examples/2c079d1ae4819a0c206b9e1aa5623523.asciidoc
Normal file
77
docs/doc_examples/2c079d1ae4819a0c206b9e1aa5623523.asciidoc
Normal file
@ -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);
|
||||
----
|
||||
@ -29,6 +29,7 @@ const response = await client.indices.create({
|
||||
"arabic_normalization",
|
||||
"persian_normalization",
|
||||
"persian_stop",
|
||||
"persian_stem",
|
||||
],
|
||||
},
|
||||
},
|
||||
16
docs/doc_examples/40f287bf733420bbab134b74c7d0ea5d.asciidoc
Normal file
16
docs/doc_examples/40f287bf733420bbab134b74c7d0ea5d.asciidoc
Normal file
@ -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
docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc
Normal file
14
docs/doc_examples/4b91ad7c9b44e07db4a4e81390f19ad3.asciidoc
Normal file
@ -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
docs/doc_examples/55085e6a2891040b6ac696561d0787c8.asciidoc
Normal file
32
docs/doc_examples/55085e6a2891040b6ac696561d0787c8.asciidoc
Normal file
@ -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);
|
||||
----
|
||||
@ -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",
|
||||
@ -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",
|
||||
18
docs/doc_examples/58dd26afc919722e21358c91e112b27a.asciidoc
Normal file
18
docs/doc_examples/58dd26afc919722e21358c91e112b27a.asciidoc
Normal file
@ -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);
|
||||
----
|
||||
22
docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc
Normal file
22
docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// 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: "semantic-embeddings",
|
||||
mappings: {
|
||||
properties: {
|
||||
semantic_text: {
|
||||
type: "semantic_text",
|
||||
inference_id: "my-elser-endpoint",
|
||||
},
|
||||
content: {
|
||||
type: "text",
|
||||
copy_to: "semantic_text",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -8,6 +8,7 @@ const response = await client.esql.asyncQuery({
|
||||
body: {
|
||||
query:
|
||||
"\n FROM cluster_one:my-index*,cluster_two:logs*\n | STATS COUNT(http.response.status_code) BY user.id\n | LIMIT 2\n ",
|
||||
include_ccs_metadata: true,
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
23
docs/doc_examples/5ceb734e3affe00e2cdc29af748d95bf.asciidoc
Normal file
23
docs/doc_examples/5ceb734e3affe00e2cdc29af748d95bf.asciidoc
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: "sparse_embedding",
|
||||
inference_id: "small_chunk_size",
|
||||
inference_config: {
|
||||
service: "elasticsearch",
|
||||
service_settings: {
|
||||
num_allocations: 1,
|
||||
num_threads: 1,
|
||||
},
|
||||
chunking_settings: {
|
||||
strategy: "sentence",
|
||||
max_chunk_size: 100,
|
||||
sentence_overlap: 0,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
19
docs/doc_examples/5cf12cc4f98d98dc79bead7e6556679c.asciidoc
Normal file
19
docs/doc_examples/5cf12cc4f98d98dc79bead7e6556679c.asciidoc
Normal file
@ -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.indices.create({
|
||||
index: "idx",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
flattened: {
|
||||
type: "flattened",
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
text: {
|
||||
type: "text",
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
versions: {
|
||||
type: "version",
|
||||
@ -4,7 +4,6 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.cluster.reroute({
|
||||
metric: "none",
|
||||
commands: [
|
||||
{
|
||||
allocate_empty_primary: {
|
||||
52
docs/doc_examples/76c73b54f3f1e5cb1c0fcccd7c3fd18e.asciidoc
Normal file
52
docs/doc_examples/76c73b54f3f1e5cb1c0fcccd7c3fd18e.asciidoc
Normal file
@ -0,0 +1,52 @@
|
||||
// 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.bulk({
|
||||
operations: [
|
||||
{
|
||||
index: {
|
||||
_index: "amazon-reviews",
|
||||
_id: "2",
|
||||
},
|
||||
},
|
||||
{
|
||||
review_text: "This product is amazing! I love it.",
|
||||
review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
|
||||
},
|
||||
{
|
||||
index: {
|
||||
_index: "amazon-reviews",
|
||||
_id: "3",
|
||||
},
|
||||
},
|
||||
{
|
||||
review_text: "This product is terrible. I hate it.",
|
||||
review_vector: [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1],
|
||||
},
|
||||
{
|
||||
index: {
|
||||
_index: "amazon-reviews",
|
||||
_id: "4",
|
||||
},
|
||||
},
|
||||
{
|
||||
review_text: "This product is great. I can do anything with it.",
|
||||
review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
|
||||
},
|
||||
{
|
||||
index: {
|
||||
_index: "amazon-reviews",
|
||||
_id: "5",
|
||||
},
|
||||
},
|
||||
{
|
||||
review_text:
|
||||
"This product has ruined my life and the lives of my family and friends.",
|
||||
review_vector: [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1],
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
18
docs/doc_examples/77082b1ffaae9ac52dfc133fa597baa7.asciidoc
Normal file
18
docs/doc_examples/77082b1ffaae9ac52dfc133fa597baa7.asciidoc
Normal file
@ -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: {
|
||||
description: {
|
||||
query: "fluffy pancakes",
|
||||
operator: "and",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
49
docs/doc_examples/79ff4e7fa5c004226d05d7e2bfb5dc1e.asciidoc
Normal file
49
docs/doc_examples/79ff4e7fa5c004226d05d7e2bfb5dc1e.asciidoc
Normal file
@ -0,0 +1,49 @@
|
||||
// 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.putIndexTemplate({
|
||||
name: "my-metrics",
|
||||
index_patterns: ["metrics-mymetrics-*"],
|
||||
priority: 200,
|
||||
data_stream: {},
|
||||
template: {
|
||||
settings: {
|
||||
"index.mode": "time_series",
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
attributes: {
|
||||
type: "passthrough",
|
||||
priority: 10,
|
||||
time_series_dimension: true,
|
||||
properties: {
|
||||
"host.name": {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
cpu: {
|
||||
type: "integer",
|
||||
time_series_metric: "counter",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.index({
|
||||
index: "metrics-mymetrics-test",
|
||||
document: {
|
||||
"@timestamp": "2020-01-01T00:00:00.000Z",
|
||||
attributes: {
|
||||
"host.name": "foo",
|
||||
zone: "bar",
|
||||
},
|
||||
cpu: 10,
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
23
docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc
Normal file
23
docs/doc_examples/7b9691bd34a02dd859562eb927f175e0.asciidoc
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: "sparse_embedding",
|
||||
inference_id: "my-elser-model",
|
||||
inference_config: {
|
||||
service: "elasticsearch",
|
||||
service_settings: {
|
||||
adaptive_allocations: {
|
||||
enabled: true,
|
||||
min_number_of_allocations: 1,
|
||||
max_number_of_allocations: 10,
|
||||
},
|
||||
num_threads: 1,
|
||||
model_id: ".elser_model_2",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
flattened: {
|
||||
type: "flattened",
|
||||
18
docs/doc_examples/7db09cab02d71f3a10d91071216d80fc.asciidoc
Normal file
18
docs/doc_examples/7db09cab02d71f3a10d91071216d80fc.asciidoc
Normal file
@ -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: "amazon-reviews",
|
||||
retriever: {
|
||||
knn: {
|
||||
field: "review_vector",
|
||||
query_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
|
||||
k: 2,
|
||||
num_candidates: 5,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
17
docs/doc_examples/7db798942cf2d334456e30ef5fcb801b.asciidoc
Normal file
17
docs/doc_examples/7db798942cf2d334456e30ef5fcb801b.asciidoc
Normal file
@ -0,0 +1,17 @@
|
||||
// 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: {
|
||||
description: {
|
||||
query: "fluffy pancakes",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -3,9 +3,10 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.putSettings({
|
||||
index: ".watches",
|
||||
settings: {
|
||||
const response = await client.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_watcher/settings",
|
||||
body: {
|
||||
"index.routing.allocation.include.role": "watcher",
|
||||
},
|
||||
});
|
||||
@ -3,9 +3,8 @@
|
||||
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.snapshot.create({
|
||||
repository: "my_repository",
|
||||
snapshot: "_verify_integrity",
|
||||
const response = await client.snapshot.repositoryVerifyIntegrity({
|
||||
name: "my_repository",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
|
||||
15
docs/doc_examples/84ef9fe951c6d3caa7438238a5b23319.asciidoc
Normal file
15
docs/doc_examples/84ef9fe951c6d3caa7438238a5b23319.asciidoc
Normal file
@ -0,0 +1,15 @@
|
||||
// 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: {
|
||||
term: {
|
||||
"author.keyword": "Maria Rodriguez",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
17
docs/doc_examples/85f9fc6f98e8573efed9b034e853d5ae.asciidoc
Normal file
17
docs/doc_examples/85f9fc6f98e8573efed9b034e853d5ae.asciidoc
Normal file
@ -0,0 +1,17 @@
|
||||
// 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: "sparse_embedding",
|
||||
inference_id: "use_existing_deployment",
|
||||
inference_config: {
|
||||
service: "elasticsearch",
|
||||
service_settings: {
|
||||
deployment_id: ".elser_model_2",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx_keep",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
path: {
|
||||
type: "object",
|
||||
61
docs/doc_examples/8d05862be1f9e7edaba162b1888b5677.asciidoc
Normal file
61
docs/doc_examples/8d05862be1f9e7edaba162b1888b5677.asciidoc
Normal file
@ -0,0 +1,61 @@
|
||||
// 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.putMapping({
|
||||
index: "cooking_blog",
|
||||
properties: {
|
||||
title: {
|
||||
type: "text",
|
||||
analyzer: "standard",
|
||||
fields: {
|
||||
keyword: {
|
||||
type: "keyword",
|
||||
ignore_above: 256,
|
||||
},
|
||||
},
|
||||
},
|
||||
description: {
|
||||
type: "text",
|
||||
fields: {
|
||||
keyword: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
author: {
|
||||
type: "text",
|
||||
fields: {
|
||||
keyword: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
date: {
|
||||
type: "date",
|
||||
format: "yyyy-MM-dd",
|
||||
},
|
||||
category: {
|
||||
type: "text",
|
||||
fields: {
|
||||
keyword: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
tags: {
|
||||
type: "text",
|
||||
fields: {
|
||||
keyword: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
rating: {
|
||||
type: "float",
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
35
docs/doc_examples/9ad0864bcd665b63551e944653d32423.asciidoc
Normal file
35
docs/doc_examples/9ad0864bcd665b63551e944653d32423.asciidoc
Normal file
@ -0,0 +1,35 @@
|
||||
// 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: "semantic-embeddings",
|
||||
retriever: {
|
||||
rrf: {
|
||||
retrievers: [
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
match: {
|
||||
content: "How to avoid muscle soreness while running?",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
standard: {
|
||||
query: {
|
||||
semantic: {
|
||||
field: "semantic_text",
|
||||
query: "How to avoid muscle soreness while running?",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,7 +4,6 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.cluster.reroute({
|
||||
metric: "none",
|
||||
commands: [
|
||||
{
|
||||
move: {
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
flattened: {
|
||||
type: "flattened",
|
||||
@ -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",
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
date: {
|
||||
type: "date_nanos",
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
bool: {
|
||||
type: "boolean",
|
||||
@ -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: "integer_range",
|
||||
21
docs/doc_examples/aab810de3314d5e11bd564ea096785b8.asciidoc
Normal file
21
docs/doc_examples/aab810de3314d5e11bd564ea096785b8.asciidoc
Normal file
@ -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.search({
|
||||
index: "cooking_blog",
|
||||
query: {
|
||||
bool: {
|
||||
filter: [
|
||||
{
|
||||
term: {
|
||||
"category.keyword": "Breakfast",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
f: {
|
||||
type: "scaled_float",
|
||||
@ -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: "date_range",
|
||||
16
docs/doc_examples/add82cbe7cd95c4be5ce1c9958f2f208.asciidoc
Normal file
16
docs/doc_examples/add82cbe7cd95c4be5ce1c9958f2f208.asciidoc
Normal file
@ -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.search({
|
||||
index: "cooking_blog",
|
||||
query: {
|
||||
multi_match: {
|
||||
query: "vegetarian curry",
|
||||
fields: ["title^3", "description^2", "tags"],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
point: {
|
||||
type: "geo_point",
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
long: {
|
||||
type: "long",
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
binary: {
|
||||
type: "binary",
|
||||
17
docs/doc_examples/b9ba66209b7fcc111a7bcef0b3e00052.asciidoc
Normal file
17
docs/doc_examples/b9ba66209b7fcc111a7bcef0b3e00052.asciidoc
Normal file
@ -0,0 +1,17 @@
|
||||
// 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: "my-index-000001",
|
||||
id: 1,
|
||||
document: {
|
||||
attributes: {
|
||||
id: "foo",
|
||||
},
|
||||
id: "bar",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
date: {
|
||||
type: "date",
|
||||
88
docs/doc_examples/bb5a67e3d2d9cd3016e487e627769fe8.asciidoc
Normal file
88
docs/doc_examples/bb5a67e3d2d9cd3016e487e627769fe8.asciidoc
Normal file
@ -0,0 +1,88 @@
|
||||
// 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.bulk({
|
||||
index: "cooking_blog",
|
||||
refresh: "wait_for",
|
||||
operations: [
|
||||
{
|
||||
index: {
|
||||
_id: "1",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Perfect Pancakes: A Fluffy Breakfast Delight",
|
||||
description:
|
||||
"Learn the secrets to making the fluffiest pancakes, so amazing you won't believe your tastebuds. This recipe uses buttermilk and a special folding technique to create light, airy pancakes that are perfect for lazy Sunday mornings.",
|
||||
author: "Maria Rodriguez",
|
||||
date: "2023-05-01",
|
||||
category: "Breakfast",
|
||||
tags: ["pancakes", "breakfast", "easy recipes"],
|
||||
rating: 4.8,
|
||||
},
|
||||
{
|
||||
index: {
|
||||
_id: "2",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Spicy Thai Green Curry: A Vegetarian Adventure",
|
||||
description:
|
||||
"Dive into the flavors of Thailand with this vibrant green curry. Packed with vegetables and aromatic herbs, this dish is both healthy and satisfying. Don't worry about the heat - you can easily adjust the spice level to your liking.",
|
||||
author: "Liam Chen",
|
||||
date: "2023-05-05",
|
||||
category: "Main Course",
|
||||
tags: ["thai", "vegetarian", "curry", "spicy"],
|
||||
rating: 4.6,
|
||||
},
|
||||
{
|
||||
index: {
|
||||
_id: "3",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Classic Beef Stroganoff: A Creamy Comfort Food",
|
||||
description:
|
||||
"Indulge in this rich and creamy beef stroganoff. Tender strips of beef in a savory mushroom sauce, served over a bed of egg noodles. It's the ultimate comfort food for chilly evenings.",
|
||||
author: "Emma Watson",
|
||||
date: "2023-05-10",
|
||||
category: "Main Course",
|
||||
tags: ["beef", "pasta", "comfort food"],
|
||||
rating: 4.7,
|
||||
},
|
||||
{
|
||||
index: {
|
||||
_id: "4",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Vegan Chocolate Avocado Mousse",
|
||||
description:
|
||||
"Discover the magic of avocado in this rich, vegan chocolate mousse. Creamy, indulgent, and secretly healthy, it's the perfect guilt-free dessert for chocolate lovers.",
|
||||
author: "Alex Green",
|
||||
date: "2023-05-15",
|
||||
category: "Dessert",
|
||||
tags: ["vegan", "chocolate", "avocado", "healthy dessert"],
|
||||
rating: 4.5,
|
||||
},
|
||||
{
|
||||
index: {
|
||||
_id: "5",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Crispy Oven-Fried Chicken",
|
||||
description:
|
||||
"Get that perfect crunch without the deep fryer! This oven-fried chicken recipe delivers crispy, juicy results every time. A healthier take on the classic comfort food.",
|
||||
author: "Maria Rodriguez",
|
||||
date: "2023-05-20",
|
||||
category: "Main Course",
|
||||
tags: ["chicken", "oven-fried", "healthy"],
|
||||
rating: 4.9,
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
16
docs/doc_examples/bc01aee2ab2ce1690986374bd836e1c7.asciidoc
Normal file
16
docs/doc_examples/bc01aee2ab2ce1690986374bd836e1c7.asciidoc
Normal file
@ -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.search({
|
||||
index: "cooking_blog",
|
||||
query: {
|
||||
multi_match: {
|
||||
query: "vegetarian curry",
|
||||
fields: ["title", "description", "tags"],
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -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",
|
||||
37
docs/doc_examples/befa73a8a419fcf3b7798548b54a20bf.asciidoc
Normal file
37
docs/doc_examples/befa73a8a419fcf3b7798548b54a20bf.asciidoc
Normal file
@ -0,0 +1,37 @@
|
||||
// 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: "my-index",
|
||||
size: 10,
|
||||
knn: {
|
||||
query_vector: [0.04283529, 0.85670587, -0.51402352, 0],
|
||||
field: "my_int4_vector",
|
||||
k: 20,
|
||||
num_candidates: 50,
|
||||
},
|
||||
rescore: {
|
||||
window_size: 20,
|
||||
query: {
|
||||
rescore_query: {
|
||||
script_score: {
|
||||
query: {
|
||||
match_all: {},
|
||||
},
|
||||
script: {
|
||||
source: "(dotProduct(params.queryVector, 'my_int4_vector') + 1.0)",
|
||||
params: {
|
||||
queryVector: [0.04283529, 0.85670587, -0.51402352, 0],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
query_weight: 0,
|
||||
rescore_query_weight: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
ip: {
|
||||
type: "ip",
|
||||
23
docs/doc_examples/c8aa8e8c0ac160b8c4efd1ac3b9f48f3.asciidoc
Normal file
23
docs/doc_examples/c8aa8e8c0ac160b8c4efd1ac3b9f48f3.asciidoc
Normal file
@ -0,0 +1,23 @@
|
||||
// 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: "amazon-reviews",
|
||||
mappings: {
|
||||
properties: {
|
||||
review_vector: {
|
||||
type: "dense_vector",
|
||||
dims: 8,
|
||||
index: true,
|
||||
similarity: "cosine",
|
||||
},
|
||||
review_text: {
|
||||
type: "text",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -52,6 +52,20 @@ const response = await client.simulate.ingest({
|
||||
},
|
||||
},
|
||||
},
|
||||
index_template_substitutions: {
|
||||
"my-index-template": {
|
||||
index_patterns: ["my-index-*"],
|
||||
composed_of: ["component_template_1", "component_template_2"],
|
||||
},
|
||||
},
|
||||
mapping_addition: {
|
||||
dynamic: "strict",
|
||||
properties: {
|
||||
foo: {
|
||||
type: "keyword",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
28
docs/doc_examples/dcf82f3aacae49c0bb4ccbc673f13e9f.asciidoc
Normal file
28
docs/doc_examples/dcf82f3aacae49c0bb4ccbc673f13e9f.asciidoc
Normal file
@ -0,0 +1,28 @@
|
||||
// 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: "my-index",
|
||||
size: 10,
|
||||
query: {
|
||||
script_score: {
|
||||
query: {
|
||||
knn: {
|
||||
query_vector: [0.04283529, 0.85670587, -0.51402352, 0],
|
||||
field: "my_int4_vector",
|
||||
num_candidates: 20,
|
||||
},
|
||||
},
|
||||
script: {
|
||||
source: "(dotProduct(params.queryVector, 'my_int4_vector') + 1.0)",
|
||||
params: {
|
||||
queryVector: [0.04283529, 0.85670587, -0.51402352, 0],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
14
docs/doc_examples/ddaadd91b7743a1c7e946ce1b593cd1b.asciidoc
Normal file
14
docs/doc_examples/ddaadd91b7743a1c7e946ce1b593cd1b.asciidoc
Normal file
@ -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.inference({
|
||||
task_type: "my-inference-endpoint",
|
||||
inference_id: "_update",
|
||||
service_settings: {
|
||||
api_key: "<API_KEY>",
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
22
docs/doc_examples/f1bf0c03581b79c3324cfa3246a60e4d.asciidoc
Normal file
22
docs/doc_examples/f1bf0c03581b79c3324cfa3246a60e4d.asciidoc
Normal file
@ -0,0 +1,22 @@
|
||||
// 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-byte-quantized-index",
|
||||
mappings: {
|
||||
properties: {
|
||||
my_vector: {
|
||||
type: "dense_vector",
|
||||
dims: 64,
|
||||
index: true,
|
||||
index_options: {
|
||||
type: "bbq_hnsw",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -4,12 +4,7 @@
|
||||
[source, js]
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
index: "cooking_blog",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,7 +5,7 @@
|
||||
----
|
||||
const response = await client.cat.mlTrainedModels({
|
||||
h: "c,o,l,ct,v",
|
||||
v: "ture",
|
||||
v: "true",
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -5,10 +5,16 @@
|
||||
----
|
||||
const response = await client.indices.create({
|
||||
index: "idx",
|
||||
mappings: {
|
||||
_source: {
|
||||
mode: "synthetic",
|
||||
settings: {
|
||||
index: {
|
||||
mapping: {
|
||||
source: {
|
||||
mode: "synthetic",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mappings: {
|
||||
properties: {
|
||||
text: {
|
||||
type: "text",
|
||||
@ -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",
|
||||
@ -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: "ip_range",
|
||||
Reference in New Issue
Block a user