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

46 lines
733 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-dfs-index",
settings: {
number_of_shards: 2,
number_of_replicas: 1,
},
mappings: {
properties: {
"my-keyword": {
type: "keyword",
},
},
},
});
console.log(response);
const response1 = await client.bulk({
index: "my-dfs-index",
refresh: "true",
operations: [
{
index: {
_id: "1",
},
},
{
"my-keyword": "a",
},
{
index: {
_id: "2",
},
},
{
"my-keyword": "b",
},
],
});
console.log(response1);
----