Added/updated snippets for docs (#2318)
This commit is contained in:
44
docs/doc_examples/40c3e7bb1fdc125a1ab21bd7d7326694.asciidoc
Normal file
44
docs/doc_examples/40c3e7bb1fdc125a1ab21bd7d7326694.asciidoc
Normal file
@ -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.indices.create({
|
||||
index: "mv",
|
||||
mappings: {
|
||||
properties: {
|
||||
b: {
|
||||
type: "long",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.bulk({
|
||||
index: "mv",
|
||||
refresh: "true",
|
||||
operations: [
|
||||
{
|
||||
index: {},
|
||||
},
|
||||
{
|
||||
a: 1,
|
||||
b: [2, 2, 1],
|
||||
},
|
||||
{
|
||||
index: {},
|
||||
},
|
||||
{
|
||||
a: 2,
|
||||
b: [1, 1],
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response1);
|
||||
|
||||
const response2 = await client.esql.query({
|
||||
query: "FROM mv | EVAL b=TO_STRING(b) | LIMIT 2",
|
||||
});
|
||||
console.log(response2);
|
||||
----
|
||||
Reference in New Issue
Block a user