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

49 lines
848 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: {
geometry: {
type: "shape",
},
},
},
});
console.log(response);
const response1 = await client.index({
index: "shapes",
id: "footprint",
document: {
geometry: {
type: "envelope",
coordinates: [
[1355, 5355],
[1400, 5200],
],
},
},
});
console.log(response1);
const response2 = await client.search({
index: "example",
query: {
shape: {
geometry: {
indexed_shape: {
index: "shapes",
id: "footprint",
path: "geometry",
},
},
},
},
});
console.log(response2);
----