49 lines
848 B
Plaintext
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);
|
|
----
|