Added/updated snippets for docs (#2318)
This commit is contained in:
27
docs/doc_examples/dee3023098d9e63aa9e113beea5686da.asciidoc
Normal file
27
docs/doc_examples/dee3023098d9e63aa9e113beea5686da.asciidoc
Normal file
@ -0,0 +1,27 @@
|
||||
// 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.searchApplication.put({
|
||||
name: "my_search_application",
|
||||
search_application: {
|
||||
indices: ["index1"],
|
||||
template: {
|
||||
script: {
|
||||
lang: "mustache",
|
||||
source:
|
||||
'\n {\n "knn": {\n "field": "{{knn_field}}",\n "query_vector": {{#toJson}}query_vector{{/toJson}},\n "k": "{{k}}",\n "num_candidates": {{num_candidates}}\n },\n "fields": {{#toJson}}fields{{/toJson}}\n }\n ',
|
||||
params: {
|
||||
knn_field: "image-vector",
|
||||
query_vector: [],
|
||||
k: 10,
|
||||
num_candidates: 100,
|
||||
fields: ["title", "file-type"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
Reference in New Issue
Block a user