diff --git a/docs/doc_examples/160986f49758f4e8345d183a842f6351.asciidoc b/docs/doc_examples/0c52af573c9401a2a687e86a4beb182b.asciidoc similarity index 92% rename from docs/doc_examples/160986f49758f4e8345d183a842f6351.asciidoc rename to docs/doc_examples/0c52af573c9401a2a687e86a4beb182b.asciidoc index 3aeb9d6f4..e0413d7dd 100644 --- a/docs/doc_examples/160986f49758f4e8345d183a842f6351.asciidoc +++ b/docs/doc_examples/0c52af573c9401a2a687e86a4beb182b.asciidoc @@ -10,7 +10,7 @@ const response = await client.ingest.putPipeline({ { attachment: { field: "data", - remove_binary: false, + remove_binary: true, }, }, ], diff --git a/docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc b/docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc new file mode 100644 index 000000000..93ccfa9d8 --- /dev/null +++ b/docs/doc_examples/2a67608dadbf220a2f040f3a79d3677d.asciidoc @@ -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); +---- diff --git a/docs/doc_examples/9f16fca9813304e398ee052aa857dbcd.asciidoc b/docs/doc_examples/48e142e6c69014e0509d4c9251749d77.asciidoc similarity index 85% rename from docs/doc_examples/9f16fca9813304e398ee052aa857dbcd.asciidoc rename to docs/doc_examples/48e142e6c69014e0509d4c9251749d77.asciidoc index 6be472e3b..7c4401c7d 100644 --- a/docs/doc_examples/9f16fca9813304e398ee052aa857dbcd.asciidoc +++ b/docs/doc_examples/48e142e6c69014e0509d4c9251749d77.asciidoc @@ -10,7 +10,8 @@ const response = await client.inference.put({ service: "openai", service_settings: { api_key: "", - model_id: "text-embedding-ada-002", + model_id: "text-embedding-3-small", + dimensions: 128, }, }, }); diff --git a/docs/doc_examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc b/docs/doc_examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc deleted file mode 100644 index d66581f09..000000000 --- a/docs/doc_examples/49b31e23f8b9667b6a7b2734d55fb6ed.asciidoc +++ /dev/null @@ -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); ----- diff --git a/docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc b/docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc new file mode 100644 index 000000000..58eee5923 --- /dev/null +++ b/docs/doc_examples/53d9d2ec9cb8d211772d764e76fe6890.asciidoc @@ -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); +---- diff --git a/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc b/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc deleted file mode 100644 index 255b2df23..000000000 --- a/docs/doc_examples/5a70db31f587b7ffed5e9bc1445430cb.asciidoc +++ /dev/null @@ -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); ----- diff --git a/docs/doc_examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc b/docs/doc_examples/80135e8c644e34cc70ce8a4e7915d1a2.asciidoc similarity index 96% rename from docs/doc_examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc rename to docs/doc_examples/80135e8c644e34cc70ce8a4e7915d1a2.asciidoc index 0bf72b678..bb8174e35 100644 --- a/docs/doc_examples/f4d0ef2e0f76babee83d999fe35127f2.asciidoc +++ b/docs/doc_examples/80135e8c644e34cc70ce8a4e7915d1a2.asciidoc @@ -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, }, }, ], diff --git a/docs/doc_examples/8cad5d95a0e7c103f08be53d0b172558.asciidoc b/docs/doc_examples/8cad5d95a0e7c103f08be53d0b172558.asciidoc deleted file mode 100644 index b5190e9a8..000000000 --- a/docs/doc_examples/8cad5d95a0e7c103f08be53d0b172558.asciidoc +++ /dev/null @@ -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); ----- diff --git a/docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc b/docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc new file mode 100644 index 000000000..3d34dce97 --- /dev/null +++ b/docs/doc_examples/931817b168e055ecf738785c721125dd.asciidoc @@ -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); +---- diff --git a/docs/doc_examples/8593715fcc70315a0816b435551258e0.asciidoc b/docs/doc_examples/93c77c65f1e11382f8043d0300e87b89.asciidoc similarity index 90% rename from docs/doc_examples/8593715fcc70315a0816b435551258e0.asciidoc rename to docs/doc_examples/93c77c65f1e11382f8043d0300e87b89.asciidoc index aae698a6f..7a9809243 100644 --- a/docs/doc_examples/8593715fcc70315a0816b435551258e0.asciidoc +++ b/docs/doc_examples/93c77c65f1e11382f8043d0300e87b89.asciidoc @@ -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", diff --git a/docs/doc_examples/b26b5574438e4eaf146b2428bf537c51.asciidoc b/docs/doc_examples/cecfaa659af6646b3b67d7b311586fa0.asciidoc similarity index 96% rename from docs/doc_examples/b26b5574438e4eaf146b2428bf537c51.asciidoc rename to docs/doc_examples/cecfaa659af6646b3b67d7b311586fa0.asciidoc index 8945d602e..bae03c0ff 100644 --- a/docs/doc_examples/b26b5574438e4eaf146b2428bf537c51.asciidoc +++ b/docs/doc_examples/cecfaa659af6646b3b67d7b311586fa0.asciidoc @@ -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, }, }, }, diff --git a/docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc b/docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc new file mode 100644 index 000000000..fac02d172 --- /dev/null +++ b/docs/doc_examples/d29031409016b2b798148ef173a196ae.asciidoc @@ -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); +---- diff --git a/docs/doc_examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc b/docs/doc_examples/d5242b1ab0213f25e5e0742032274ce6.asciidoc similarity index 96% rename from docs/doc_examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc rename to docs/doc_examples/d5242b1ab0213f25e5e0742032274ce6.asciidoc index 3302992dc..865d407f9 100644 --- a/docs/doc_examples/35fd9549350926f8d57dc1765e2f40d3.asciidoc +++ b/docs/doc_examples/d5242b1ab0213f25e5e0742032274ce6.asciidoc @@ -10,7 +10,7 @@ const response = await client.ingest.putPipeline({ { attachment: { field: "data", - remove_binary: false, + remove_binary: true, }, }, ], diff --git a/docs/doc_examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc b/docs/doc_examples/e77c2f41a7eca765b0c5f734a66d919f.asciidoc similarity index 93% rename from docs/doc_examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc rename to docs/doc_examples/e77c2f41a7eca765b0c5f734a66d919f.asciidoc index d17ba0b28..76351698d 100644 --- a/docs/doc_examples/5ba32ebaa7ee28a339c7693696d305ca.asciidoc +++ b/docs/doc_examples/e77c2f41a7eca765b0c5f734a66d919f.asciidoc @@ -11,7 +11,7 @@ const response = await client.ingest.putPipeline({ attachment: { field: "data", properties: ["content", "title"], - remove_binary: false, + remove_binary: true, }, }, ], diff --git a/docs/doc_examples/bb5a1319c496acc862c670cc7224e59a.asciidoc b/docs/doc_examples/ea8c4229afa6dd4f1321355542be9912.asciidoc similarity index 96% rename from docs/doc_examples/bb5a1319c496acc862c670cc7224e59a.asciidoc rename to docs/doc_examples/ea8c4229afa6dd4f1321355542be9912.asciidoc index d3998b385..c4744fb4e 100644 --- a/docs/doc_examples/bb5a1319c496acc862c670cc7224e59a.asciidoc +++ b/docs/doc_examples/ea8c4229afa6dd4f1321355542be9912.asciidoc @@ -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, }, }, ],