36 lines
631 B
Plaintext
36 lines
631 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: "trips",
|
|
mappings: {
|
|
properties: {
|
|
distance: {
|
|
type: "long",
|
|
},
|
|
route_length_miles: {
|
|
type: "alias",
|
|
path: "distance",
|
|
},
|
|
transit_mode: {
|
|
type: "keyword",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.search({
|
|
query: {
|
|
range: {
|
|
route_length_miles: {
|
|
gte: 39,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response1);
|
|
----
|