45 lines
899 B
Plaintext
45 lines
899 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.search({
|
|
index: "index",
|
|
query: {
|
|
constant_score: {
|
|
filter: {
|
|
bool: {
|
|
should: [
|
|
{
|
|
range: {
|
|
my_date: {
|
|
gte: "now-1h",
|
|
lte: "now-1h/m",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
range: {
|
|
my_date: {
|
|
gt: "now-1h/m",
|
|
lt: "now/m",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
range: {
|
|
my_date: {
|
|
gte: "now/m",
|
|
lte: "now",
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
console.log(response);
|
|
----
|