Hi,
I have the following query:
{
"query": {
"bool": {
"must": {
"has_parent": {
"type": "premises",
"score_mode": "score",
"query": {
"bool": {
"must": {
"match": {
"street": {
"query": "Generaal jacques",
"minimum_should_match": "70%"
}
},
"filter": {
"bool": {
"must": [
{
"term": {
"backyard": "S"
}
},
{
"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": 1497129105
}
}
}
]
}
}
}
}
}
},
{
"term": {
"status_published": 1
}
},
{
"term": {
"status_visible": 1
}
},
{
"term": {
"status_approved": 1
}
}
]
}
}
}
}
},
"sort": [
"_score",
{
"surface_area": "desc"
}
],
"size": 10,
"_source": false
}
The sort seems to be completely ignored, and I can't figure out why, as it sorts on a field of the child which we are querying. In short: the query looks for rooms that match certain criteria (filter) and for which the parent (the premises in which the room is housed) address matches the search term.
Any idea what could cause this? Or how should I understand this? Are there solutions?
Kind regards
pieter