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

42 lines
783 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: {
number_one: {
type: "integer",
ignore_malformed: true,
},
number_two: {
type: "integer",
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "my-index-000001",
id: 1,
document: {
text: "Some text value",
number_one: "foo",
},
});
console.log(response1);
const response2 = await client.index({
index: "my-index-000001",
id: 2,
document: {
text: "Some text value",
number_two: "foo",
},
});
console.log(response2);
----