Auto-generated API code (#2344)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
57
docs/doc_examples/5fd002a018c589eb73fadad25889dbe9.asciidoc
Normal file
57
docs/doc_examples/5fd002a018c589eb73fadad25889dbe9.asciidoc
Normal file
@ -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.transport.request({
|
||||
method: "PUT",
|
||||
path: "/_query_rules/my-ruleset",
|
||||
body: {
|
||||
rules: [
|
||||
{
|
||||
rule_id: "rule1",
|
||||
type: "pinned",
|
||||
criteria: [
|
||||
{
|
||||
type: "fuzzy",
|
||||
metadata: "query_string",
|
||||
values: ["puggles", "pugs"],
|
||||
},
|
||||
{
|
||||
type: "exact",
|
||||
metadata: "user_country",
|
||||
values: ["us"],
|
||||
},
|
||||
],
|
||||
actions: {
|
||||
ids: ["id1", "id2"],
|
||||
},
|
||||
},
|
||||
{
|
||||
rule_id: "rule2",
|
||||
type: "exclude",
|
||||
criteria: [
|
||||
{
|
||||
type: "contains",
|
||||
metadata: "query_string",
|
||||
values: ["beagles"],
|
||||
},
|
||||
],
|
||||
actions: {
|
||||
docs: [
|
||||
{
|
||||
_index: "my-index-000001",
|
||||
_id: "id3",
|
||||
},
|
||||
{
|
||||
_index: "my-index-000002",
|
||||
_id: "id4",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
----
|
||||
Reference in New Issue
Block a user