-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbd0ec2
commit 7d5ab38
Showing
34 changed files
with
1,024 additions
and
102 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
docs/doc_examples/015e6e6132b6d6d44bddb06bc3b316ed.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// 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: "retrievers_example", | ||
retriever: { | ||
rrf: { | ||
retrievers: [ | ||
{ | ||
standard: { | ||
query: { | ||
range: { | ||
year: { | ||
gt: 2023, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
standard: { | ||
query: { | ||
term: { | ||
topic: "elastic", | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
rank_window_size: 10, | ||
rank_constant: 1, | ||
}, | ||
}, | ||
_source: false, | ||
aggs: { | ||
topics: { | ||
terms: { | ||
field: "topic", | ||
}, | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
18 changes: 18 additions & 0 deletions
18
docs/doc_examples/0165d22da5f2fc7678392b31d8eb5566.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.inference.put({ | ||
task_type: "rerank", | ||
inference_id: "my-rerank-model", | ||
inference_config: { | ||
service: "cohere", | ||
service_settings: { | ||
model_id: "rerank-english-v3.0", | ||
api_key: "{{COHERE_API_KEY}}", | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
49 changes: 49 additions & 0 deletions
49
docs/doc_examples/0bc6155e0c88062a4d8490da49db3aa8.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.search({ | ||
index: "retrievers_example_nested", | ||
retriever: { | ||
rrf: { | ||
retrievers: [ | ||
{ | ||
standard: { | ||
query: { | ||
nested: { | ||
path: "nested_field", | ||
inner_hits: { | ||
name: "nested_vector", | ||
_source: false, | ||
fields: ["nested_field.paragraph_id"], | ||
}, | ||
query: { | ||
knn: { | ||
field: "nested_field.nested_vector", | ||
query_vector: [1, 0, 0.5], | ||
k: 10, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
standard: { | ||
query: { | ||
term: { | ||
topic: "ai", | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
rank_window_size: 10, | ||
rank_constant: 1, | ||
}, | ||
}, | ||
_source: ["topic"], | ||
}); | ||
console.log(response); | ||
---- |
57 changes: 57 additions & 0 deletions
57
docs/doc_examples/0d689ac6e78be5d438f9b5d441be2b44.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// 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: "retrievers_example", | ||
retriever: { | ||
rrf: { | ||
retrievers: [ | ||
{ | ||
standard: { | ||
query: { | ||
term: { | ||
topic: "elastic", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
rrf: { | ||
retrievers: [ | ||
{ | ||
standard: { | ||
query: { | ||
query_string: { | ||
query: | ||
"(information retrieval) OR (artificial intelligence)", | ||
default_field: "text", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
knn: { | ||
field: "vector", | ||
query_vector: [0.23, 0.67, 0.89], | ||
k: 3, | ||
num_candidates: 5, | ||
}, | ||
}, | ||
], | ||
rank_window_size: 10, | ||
rank_constant: 1, | ||
}, | ||
}, | ||
], | ||
rank_window_size: 10, | ||
rank_constant: 1, | ||
}, | ||
}, | ||
_source: false, | ||
size: 1, | ||
explain: true, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
docs/doc_examples/2577acb462b95bd4394523cf2f8a661f.asciidoc
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
docs/doc_examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
docs/doc_examples/30d051f534aeb884176eedb2c11dac85.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.inference.put({ | ||
task_type: "rerank", | ||
inference_id: "my-elastic-rerank", | ||
inference_config: { | ||
service: "elasticsearch", | ||
service_settings: { | ||
model_id: ".rerank-v1", | ||
num_threads: 1, | ||
adaptive_allocations: { | ||
enabled: true, | ||
min_number_of_allocations: 1, | ||
max_number_of_allocations: 4, | ||
}, | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
docs/doc_examples/76e02434835630cb830724beb92df354.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// 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: "retrievers_example", | ||
retriever: { | ||
rrf: { | ||
retrievers: [ | ||
{ | ||
knn: { | ||
field: "vector", | ||
query_vector: [0.23, 0.67, 0.89], | ||
k: 3, | ||
num_candidates: 5, | ||
}, | ||
}, | ||
{ | ||
text_similarity_reranker: { | ||
retriever: { | ||
standard: { | ||
query: { | ||
term: { | ||
topic: "ai", | ||
}, | ||
}, | ||
}, | ||
}, | ||
field: "text", | ||
inference_id: "my-rerank-model", | ||
inference_text: | ||
"Can I use generative AI to identify user intent and improve search relevance?", | ||
}, | ||
}, | ||
], | ||
rank_window_size: 10, | ||
rank_constant: 1, | ||
}, | ||
}, | ||
_source: false, | ||
}); | ||
console.log(response); | ||
---- |
46 changes: 46 additions & 0 deletions
46
docs/doc_examples/78043831fd32004a82930c8ac8a1d809.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// 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: "retrievers_example", | ||
retriever: { | ||
text_similarity_reranker: { | ||
retriever: { | ||
rrf: { | ||
retrievers: [ | ||
{ | ||
standard: { | ||
query: { | ||
query_string: { | ||
query: | ||
"(information retrieval) OR (artificial intelligence)", | ||
default_field: "text", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
knn: { | ||
field: "vector", | ||
query_vector: [0.23, 0.67, 0.89], | ||
k: 3, | ||
num_candidates: 5, | ||
}, | ||
}, | ||
], | ||
rank_window_size: 10, | ||
rank_constant: 1, | ||
}, | ||
}, | ||
field: "text", | ||
inference_id: "my-rerank-model", | ||
inference_text: | ||
"What are the state of the art applications of AI in information retrieval?", | ||
}, | ||
}, | ||
_source: false, | ||
}); | ||
console.log(response); | ||
---- |
Oops, something went wrong.