Files
elasticsearch-js/docs/doc_examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc
2024-07-29 17:10:05 -05:00

38 lines
674 B
Plaintext

// 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: "my-index-000001",
mappings: {
properties: {
is_published: {
type: "boolean",
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "my-index-000001",
id: 1,
refresh: "true",
document: {
is_published: "true",
},
});
console.log(response1);
const response2 = await client.search({
index: "my-index-000001",
query: {
term: {
is_published: true,
},
},
});
console.log(response2);
----