Auto-generated code for 8.x (#2412)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
37
docs/doc_examples/befa73a8a419fcf3b7798548b54a20bf.asciidoc
Normal file
37
docs/doc_examples/befa73a8a419fcf3b7798548b54a20bf.asciidoc
Normal file
@ -0,0 +1,37 @@
|
||||
// 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",
|
||||
size: 10,
|
||||
knn: {
|
||||
query_vector: [0.04283529, 0.85670587, -0.51402352, 0],
|
||||
field: "my_int4_vector",
|
||||
k: 20,
|
||||
num_candidates: 50,
|
||||
},
|
||||
rescore: {
|
||||
window_size: 20,
|
||||
query: {
|
||||
rescore_query: {
|
||||
script_score: {
|
||||
query: {
|
||||
match_all: {},
|
||||
},
|
||||
script: {
|
||||
source: "(dotProduct(params.queryVector, 'my_int4_vector') + 1.0)",
|
||||
params: {
|
||||
queryVector: [0.04283529, 0.85670587, -0.51402352, 0],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
query_weight: 0,
|
||||
rescore_query_weight: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
Reference in New Issue
Block a user