Auto-generated code for 8.15 (#2539)
This commit is contained in:
@ -10,7 +10,7 @@ const response = await client.ingest.putPipeline({
|
||||
{
|
||||
attachment: {
|
||||
field: "data",
|
||||
remove_binary: false,
|
||||
remove_binary: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
35
docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc
Normal file
35
docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.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.ingest.putPipeline({
|
||||
id: "attachment",
|
||||
description: "Extract attachment information including original binary",
|
||||
processors: [
|
||||
{
|
||||
attachment: {
|
||||
field: "data",
|
||||
remove_binary: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.index({
|
||||
index: "my-index-000001",
|
||||
id: "my_id",
|
||||
pipeline: "attachment",
|
||||
document: {
|
||||
data: "e1xydGYxXGFuc2kNCkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0DQpccGFyIH0=",
|
||||
},
|
||||
});
|
||||
console.log(response1);
|
||||
|
||||
const response2 = await client.get({
|
||||
index: "my-index-000001",
|
||||
id: "my_id",
|
||||
});
|
||||
console.log(response2);
|
||||
----
|
||||
@ -10,7 +10,8 @@ const response = await client.inference.put({
|
||||
service: "openai",
|
||||
service_settings: {
|
||||
api_key: "<api_key>",
|
||||
model_id: "text-embedding-ada-002",
|
||||
model_id: "text-embedding-3-small",
|
||||
dimensions: 128,
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -1,17 +0,0 @@
|
||||
// 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.knnSearch({
|
||||
index: "my-index",
|
||||
knn: {
|
||||
field: "image_vector",
|
||||
query_vector: [0.3, 0.1, 1.2],
|
||||
k: 10,
|
||||
num_candidates: 100,
|
||||
},
|
||||
_source: ["name", "file_type"],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
18
docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc
Normal file
18
docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.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.ingest.simulate({
|
||||
id: "query_helper_pipeline",
|
||||
docs: [
|
||||
{
|
||||
_source: {
|
||||
content:
|
||||
"artificial intelligence in medicine articles published in the last 12 months",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -1,22 +0,0 @@
|
||||
// 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);
|
||||
----
|
||||
@ -12,7 +12,7 @@ const response = await client.ingest.putPipeline({
|
||||
field: "data",
|
||||
indexed_chars: 11,
|
||||
indexed_chars_field: "max_size",
|
||||
remove_binary: false,
|
||||
remove_binary: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
@ -1,22 +0,0 @@
|
||||
// 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-endpoint",
|
||||
inference_config: {
|
||||
service: "elser",
|
||||
service_settings: {
|
||||
adaptive_allocations: {
|
||||
enabled: true,
|
||||
min_number_of_allocations: 3,
|
||||
max_number_of_allocations: 10,
|
||||
},
|
||||
num_threads: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
32
docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc
Normal file
32
docs/doc_examples/931817b168e055ecf738785c721125dd.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.ingest.putPipeline({
|
||||
id: "query_helper_pipeline",
|
||||
processors: [
|
||||
{
|
||||
script: {
|
||||
source:
|
||||
"ctx.prompt = 'Please generate an elasticsearch search query on index `articles_index` for the following natural language query. Dates are in the field `@timestamp`, document types are in the field `type` (options are `news`, `publication`), categories in the field `category` and can be multiple (options are `medicine`, `pharmaceuticals`, `technology`), and document names are in the field `title` which should use a fuzzy match. Ignore fields which cannot be determined from the natural language query context: ' + ctx.content",
|
||||
},
|
||||
},
|
||||
{
|
||||
inference: {
|
||||
model_id: "openai_chat_completions",
|
||||
input_output: {
|
||||
input_field: "prompt",
|
||||
output_field: "query",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
remove: {
|
||||
field: "prompt",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -9,7 +9,7 @@ const response = await client.indices.create({
|
||||
properties: {
|
||||
infer_field: {
|
||||
type: "semantic_text",
|
||||
inference_id: "my-elser-endpoint",
|
||||
inference_id: ".elser-2-elasticsearch",
|
||||
},
|
||||
source_field: {
|
||||
type: "text",
|
||||
@ -14,7 +14,7 @@ const response = await client.ingest.putPipeline({
|
||||
attachment: {
|
||||
target_field: "_ingest._value.attachment",
|
||||
field: "_ingest._value.data",
|
||||
remove_binary: false,
|
||||
remove_binary: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
24
docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc
Normal file
24
docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc
Normal file
@ -0,0 +1,24 @@
|
||||
// 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: "test-index",
|
||||
query: {
|
||||
semantic: {
|
||||
field: "my_semantic_field",
|
||||
},
|
||||
},
|
||||
highlight: {
|
||||
fields: {
|
||||
my_semantic_field: {
|
||||
type: "semantic",
|
||||
number_of_fragments: 2,
|
||||
order: "score",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
@ -10,7 +10,7 @@ const response = await client.ingest.putPipeline({
|
||||
{
|
||||
attachment: {
|
||||
field: "data",
|
||||
remove_binary: false,
|
||||
remove_binary: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
@ -11,7 +11,7 @@ const response = await client.ingest.putPipeline({
|
||||
attachment: {
|
||||
field: "data",
|
||||
properties: ["content", "title"],
|
||||
remove_binary: false,
|
||||
remove_binary: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
@ -12,7 +12,7 @@ const response = await client.ingest.putPipeline({
|
||||
field: "data",
|
||||
indexed_chars: 11,
|
||||
indexed_chars_field: "max_size",
|
||||
remove_binary: false,
|
||||
remove_binary: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
Reference in New Issue
Block a user