Skip to content

Instantly share code, notes, and snippets.

@pieterdt
Created September 23, 2016 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pieterdt/4c6c1450a17954ff32055f0eb654d081 to your computer and use it in GitHub Desktop.
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
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