49 lines
828 B
Plaintext
49 lines
828 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({
|
|
body: {
|
|
query: {
|
|
bool: {
|
|
must: {
|
|
term: {
|
|
user: 'kimchy'
|
|
}
|
|
},
|
|
filter: {
|
|
term: {
|
|
tag: 'tech'
|
|
}
|
|
},
|
|
must_not: {
|
|
range: {
|
|
age: {
|
|
gte: 10,
|
|
lte: 20
|
|
}
|
|
}
|
|
},
|
|
should: [
|
|
{
|
|
term: {
|
|
tag: 'wow'
|
|
}
|
|
},
|
|
{
|
|
term: {
|
|
tag: 'elasticsearch'
|
|
}
|
|
}
|
|
],
|
|
minimum_should_match: 1,
|
|
boost: 1
|
|
}
|
|
}
|
|
}
|
|
})
|
|
console.log(response)
|
|
----
|
|
|