Skip to content

Commit

Permalink
Auto-generated API code (#2587)
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jan 28, 2025
1 parent 3627a4c commit 3d3c72d
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 479 deletions.
23 changes: 23 additions & 0 deletions docs/doc_examples/2f72a63c73dd672ac2dc3997ad15dd41.asciidoc
Original file line number Diff line number Diff line change
@@ -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: "test-index",
mappings: {
properties: {
source_field: {
type: "text",
fields: {
infer_field: {
type: "semantic_text",
inference_id: ".elser-2-elasticsearch",
},
},
},
},
},
});
console.log(response);
----
23 changes: 0 additions & 23 deletions docs/doc_examples/38ba93890494bfa7beece58dffa44f98.asciidoc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@
----
const response = await client.indices.create({
index: "retrievers_example",
settings: {
number_of_shards: 1,
},
mappings: {
properties: {
vector: {
type: "dense_vector",
dims: 3,
similarity: "l2_norm",
index: true,
index_options: {
type: "flat",
},
},
text: {
type: "text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ const response = await client.indices.create({
index: "test-index",
mappings: {
properties: {
infer_field: {
type: "semantic_text",
inference_id: ".elser-2-elasticsearch",
},
source_field: {
type: "text",
copy_to: "infer_field",
},
infer_field: {
type: "semantic_text",
inference_id: ".elser-2-elasticsearch",
},
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
----
const response = await client.indices.create({
index: "retrievers_example_nested",
settings: {
number_of_shards: 1,
},
mappings: {
properties: {
nested_field: {
Expand All @@ -18,6 +21,9 @@ const response = await client.indices.create({
dims: 3,
similarity: "l2_norm",
index: true,
index_options: {
type: "flat",
},
},
},
},
Expand Down
Loading

0 comments on commit 3d3c72d

Please sign in to comment.