Skip to content

Commit

Permalink
Auto-generated code for main (#2368)
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Sep 30, 2024
1 parent aad41df commit 428a7b0
Show file tree
Hide file tree
Showing 31 changed files with 863 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[source, js]
----
const response = await client.indices.create({
index: "my-index-000002",
index: "my-index-000003",
mappings: {
properties: {
metrics: {
Expand All @@ -29,7 +29,7 @@ const response = await client.indices.create({
console.log(response);
const response1 = await client.indices.getMapping({
index: "my-index-000002",
index: "my-index-000003",
});
console.log(response1);
----
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const response = await client.inference.put({
min_number_of_allocations: 3,
max_number_of_allocations: 10,
},
num_threads: 1,
model_id: ".multilingual-e5-small",
},
},
Expand Down
18 changes: 18 additions & 0 deletions docs/doc_examples/43d9e314431336a6f084cea76dfd6489.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: "restaurants",
retriever: {
knn: {
field: "vector",
query_vector: [10, 22, 77],
k: 10,
num_candidates: 10,
},
},
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const response = await client.inference.put({
min_number_of_allocations: 3,
max_number_of_allocations: 10,
},
num_threads: 1,
},
},
});
Expand Down
19 changes: 19 additions & 0 deletions docs/doc_examples/58f6b72009512851843c7b7a20e9504a.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.indices.create({
index: "my-index-000002",
mappings: {
properties: {
inference_field: {
type: "semantic_text",
inference_id: "my-elser-endpoint-for-ingest",
search_inference_id: "my-elser-endpoint-for-search",
},
},
},
});
console.log(response);
----
19 changes: 19 additions & 0 deletions docs/doc_examples/69541f0bb81ab3797926bb2a00607cda.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.inference.put({
task_type: "rerank",
inference_id: "my-msmarco-minilm-model",
inference_config: {
service: "elasticsearch",
service_settings: {
num_allocations: 1,
num_threads: 1,
model_id: "cross-encoder__ms-marco-minilm-l-6-v2",
},
},
});
console.log(response);
----
45 changes: 45 additions & 0 deletions docs/doc_examples/6e6b78e6b689a5d6aa637271b6d084e2.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 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: "movies",
retriever: {
rrf: {
retrievers: [
{
standard: {
query: {
sparse_vector: {
field: "plot_embedding",
inference_id: "my-elser-model",
query: "films that explore psychological depths",
},
},
},
},
{
standard: {
query: {
multi_match: {
query: "crime",
fields: ["plot", "title"],
},
},
},
},
{
knn: {
field: "vector",
query_vector: [10, 22, 77],
k: 10,
num_candidates: 10,
},
},
],
},
},
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const response = await client.search({
filter: {
range: {
price: {
to: "500",
lte: "500",
},
},
},
Expand Down
51 changes: 51 additions & 0 deletions docs/doc_examples/7b1b947bddd7e78f77da265f7e645a61.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// 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-000004",
mappings: {
properties: {
metrics: {
subobjects: "auto",
properties: {
time: {
type: "object",
properties: {
min: {
type: "long",
},
},
},
to: {
type: "object",
properties: {
inner_metrics: {
type: "object",
subobjects: "auto",
properties: {
time: {
type: "object",
properties: {
max: {
type: "long",
},
},
},
},
},
},
},
},
},
},
},
});
console.log(response);
const response1 = await client.indices.getMapping({
index: "my-index-000004",
});
console.log(response1);
----
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const response = await client.search({
{
range: {
"result.execution_time": {
from: "now-10s",
gte: "now-10s",
},
},
},
Expand Down
20 changes: 20 additions & 0 deletions docs/doc_examples/8477e77e4fad19af66f03f81b8f2592b.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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",
query: {
semantic: {
field: "inference_field",
query: "mountain lake",
inner_hits: {
from: 1,
size: 1,
},
},
},
});
console.log(response);
----
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ const response = await client.inference.put({
inference_config: {
service: "elser",
service_settings: {
num_allocations: 1,
adaptive_allocations: {
enabled: true,
min_number_of_allocations: 3,
max_number_of_allocations: 10,
},
num_threads: 1,
},
},
Expand Down
17 changes: 17 additions & 0 deletions docs/doc_examples/8d750dfc067b1184c32a2423c60e4d06.asciidoc
Original file line number Diff line number Diff line change
@@ -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: "my-index",
query: {
semantic: {
field: "inference_field",
query: "mountain lake",
inner_hits: {},
},
},
});
console.log(response);
----
36 changes: 36 additions & 0 deletions docs/doc_examples/9169d19a80175ec94f80865d0f9bef4c.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// 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: "restaurants",
retriever: {
rrf: {
retrievers: [
{
standard: {
query: {
multi_match: {
query: "Austria",
fields: ["city", "region"],
},
},
},
},
{
knn: {
field: "vector",
query_vector: [10, 22, 77],
k: 10,
num_candidates: 10,
},
},
],
rank_constant: 1,
rank_window_size: 50,
},
},
});
console.log(response);
----
26 changes: 26 additions & 0 deletions docs/doc_examples/971fd23adb81bb5842c7750e0379336a.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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: "movies",
retriever: {
text_similarity_reranker: {
retriever: {
standard: {
query: {
match: {
genre: "drama",
},
},
},
},
field: "plot",
inference_id: "my-msmarco-minilm-model",
inference_text: "films that explore psychological depths",
},
},
});
console.log(response);
----
17 changes: 17 additions & 0 deletions docs/doc_examples/9dfe3b02bd15409b4b8b36e9756e8f94.asciidoc
Original file line number Diff line number Diff line change
@@ -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",
id: "lake_tahoe",
document: {
inference_field: [
"Lake Tahoe is the largest alpine lake in North America",
"When hiking in the area, please be on alert for bears",
],
},
});
console.log(response);
----
28 changes: 28 additions & 0 deletions docs/doc_examples/a1dda7e7c01be96a4acf7b725d70385f.asciidoc
Original file line number Diff line number Diff line change
@@ -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: "index",
retriever: {
text_similarity_reranker: {
retriever: {
standard: {
query: {
match_phrase: {
text: "landmark in Paris",
},
},
},
},
field: "text",
inference_id: "my-cohere-rerank-model",
inference_text: "Most famous landmark in Paris",
rank_window_size: 100,
min_score: 0.5,
},
},
});
console.log(response);
----
Loading

0 comments on commit 428a7b0

Please sign in to comment.