Created
September 23, 2016 21:21
-
-
Save pieterdt/4c6c1450a17954ff32055f0eb654d081 to your computer and use it in GitHub Desktop.
Troubling Elastic search query that seems to ignore both size and from parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST 'http://192.168.50.2:9200/prod_brik/room/_search' | |
{ | |
"query": { | |
"bool": { | |
"must": { | |
"has_parent": { | |
"type": "premises", | |
"score_mode": "score", | |
"query": { | |
"bool": { | |
"must": { | |
"match": { | |
"street": { | |
"query": "Dansaertstraat", | |
"minimum_should_match": "70%" | |
} | |
}, | |
"filter": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"status_published": 1 | |
} | |
}, | |
{ | |
"term": { | |
"status_visible": 1 | |
} | |
}, | |
{ | |
"term": { | |
"status_approved": 1 | |
} | |
} | |
] | |
} | |
} | |
} | |
} | |
} | |
}, | |
"filter": { | |
"bool": { | |
"must": [ | |
{ | |
"range": { | |
"rent_basic": { | |
"gte": "200", | |
"lte": "600" | |
} | |
} | |
}, | |
{ | |
"nested": { | |
"path": "period", | |
"score_mode": "none", | |
"query": { | |
"constant_score": { | |
"filter": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"period.available": 1 | |
} | |
}, | |
{ | |
"range": { | |
"period.start": { | |
"lte": 1505433601 | |
} | |
} | |
}, | |
{ | |
"range": { | |
"period.end": { | |
"gte": 1474662357 | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"term": { | |
"status_published": 1 | |
} | |
}, | |
{ | |
"term": { | |
"status_visible": 1 | |
} | |
}, | |
{ | |
"term": { | |
"status_approved": 1 | |
} | |
} | |
] | |
} | |
} | |
} | |
} | |
}, | |
"sort": [ | |
"_score", | |
{ | |
"changed": "desc" | |
} | |
], | |
"from": 2, | |
"size": 2, | |
"_source": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment