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

53 lines
916 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: "shapes",
mappings: {
properties: {
location: {
type: "geo_shape",
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "shapes",
id: "deu",
document: {
location: {
type: "envelope",
coordinates: [
[13, 53],
[14, 52],
],
},
},
});
console.log(response1);
const response2 = await client.search({
index: "example",
query: {
bool: {
filter: {
geo_shape: {
location: {
indexed_shape: {
index: "shapes",
id: "deu",
path: "location",
},
},
},
},
},
},
});
console.log(response2);
----