35 lines
675 B
Plaintext
35 lines
675 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: {
|
|
dynamic_templates: [
|
|
{
|
|
longs_as_strings: {
|
|
match_mapping_type: "string",
|
|
match: "long_*",
|
|
unmatch: "*_text",
|
|
mapping: {
|
|
type: "long",
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.index({
|
|
index: "my-index-000001",
|
|
id: 1,
|
|
document: {
|
|
long_num: "5",
|
|
long_text: "foo",
|
|
},
|
|
});
|
|
console.log(response1);
|
|
----
|