42 lines
783 B
Plaintext
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);
|
|
----
|