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

70 lines
1.4 KiB
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: [
{
numeric_counts: {
match_mapping_type: ["long", "double"],
match: "count",
mapping: {
type: "{dynamic_type}",
index: false,
},
},
},
{
integers: {
match_mapping_type: "long",
mapping: {
type: "integer",
},
},
},
{
strings: {
match_mapping_type: "string",
mapping: {
type: "text",
fields: {
raw: {
type: "keyword",
ignore_above: 256,
},
},
},
},
},
{
non_objects_keyword: {
match_mapping_type: "*",
unmatch_mapping_type: "object",
mapping: {
type: "keyword",
},
},
},
],
},
});
console.log(response);
const response1 = await client.index({
index: "my-index-000001",
id: 1,
document: {
my_integer: 5,
my_string: "Some string",
my_boolean: "false",
field: {
count: 4,
},
},
});
console.log(response1);
----