42 lines
777 B
Plaintext
42 lines
777 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: "range_index",
|
|
settings: {
|
|
number_of_shards: 2,
|
|
},
|
|
mappings: {
|
|
properties: {
|
|
expected_attendees: {
|
|
type: "integer_range",
|
|
},
|
|
time_frame: {
|
|
type: "date_range",
|
|
format: "yyyy-MM-dd||epoch_millis",
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
|
|
const response1 = await client.index({
|
|
index: "range_index",
|
|
id: 1,
|
|
refresh: "true",
|
|
document: {
|
|
expected_attendees: {
|
|
gte: 10,
|
|
lte: 20,
|
|
},
|
|
time_frame: {
|
|
gte: "2019-10-28",
|
|
lte: "2019-11-04",
|
|
},
|
|
},
|
|
});
|
|
console.log(response1);
|
|
----
|