IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Bool Dsl Complex Query Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Bool Dsl Complex Query Usage
editFluent DSL example
editq.Query() && q.Query() //second bool || (+q.Query() || +q.Query() || !q.Query() && (!q.Query() && !q.ConditionlessQuery())) // simple nested or && (q.Query() || q.Query() || q.Query()) //all conditionless bool && (q.NullQuery() || +q.ConditionlessQuery() || !q.ConditionlessQuery()) // actual bool query && base.QueryFluent(q)
Object Initializer syntax example
editQuery && Query //second bool || (+Query || +Query || !Query && (!Query && !ConditionlessQuery)) // simple nested or && (Query || Query || Query) //all conditionless bool && (NullQuery || +ConditionlessQuery || !ConditionlessQuery) // actual bool query && base.QueryInitializer
Example json output.
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"x": {
"value": "y"
}
}
},
{
"term": {
"x": {
"value": "y"
}
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"filter": [
{
"term": {
"x": {
"value": "y"
}
}
}
]
}
},
{
"bool": {
"filter": [
{
"term": {
"x": {
"value": "y"
}
}
}
]
}
},
{
"bool": {
"must_not": [
{
"term": {
"x": {
"value": "y"
}
}
},
{
"term": {
"x": {
"value": "y"
}
}
}
]
}
}
]
}
},
{
"bool": {
"should": [
{
"term": {
"x": {
"value": "y"
}
}
},
{
"term": {
"x": {
"value": "y"
}
}
},
{
"term": {
"x": {
"value": "y"
}
}
}
]
}
},
{
"bool": {
"must": [
{
"match_all": {}
}
],
"must_not": [
{
"match_all": {}
}
],
"should": [
{
"match_all": {}
}
],
"filter": [
{
"match_all": {}
}
],
"minimum_should_match": 1,
"boost": 2.0
}
}
]
}
}
]
}
}