Added/updated snippets for docs (#2318)
This commit is contained in:
54
docs/doc_examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc
Normal file
54
docs/doc_examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc
Normal file
@ -0,0 +1,54 @@
|
||||
// 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",
|
||||
mappings: {
|
||||
dynamic_templates: [
|
||||
{
|
||||
geo_point: {
|
||||
mapping: {
|
||||
type: "geo_point",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
const response1 = await client.bulk({
|
||||
operations: [
|
||||
{
|
||||
index: {
|
||||
_index: "my_index",
|
||||
_id: "1",
|
||||
dynamic_templates: {
|
||||
work_location: "geo_point",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "value1",
|
||||
work_location: "41.12,-71.34",
|
||||
raw_location: "41.12,-71.34",
|
||||
},
|
||||
{
|
||||
create: {
|
||||
_index: "my_index",
|
||||
_id: "2",
|
||||
dynamic_templates: {
|
||||
home_location: "geo_point",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "value2",
|
||||
home_location: "41.12,-71.34",
|
||||
},
|
||||
],
|
||||
});
|
||||
console.log(response1);
|
||||
----
|
||||
Reference in New Issue
Block a user