Last active
August 25, 2016 12:29
-
-
Save DevWurm/524c8dcdf70413e05f16a4c6a03553ee to your computer and use it in GitHub Desktop.
Elasticsearch Query
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
{ | |
"settings": { | |
"number_of_shards" : 10, | |
"number_of_replicas" : 0 | |
}, | |
"mappings": { | |
"article": { | |
"properties": { | |
"name": {"type": "string"}, | |
"counts": { | |
"type": "nested", | |
"properties": { | |
"date": {"type": "date", "format": "strict_date_time"}, | |
"count": {"type": "long"} | |
} | |
} | |
} | |
} | |
} | |
} |
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
{"_source": | |
["article","counts.*"], | |
"query": { | |
"bool": { | |
"filter": { | |
"bool": { | |
"must_not":[] | |
} | |
} | |
} | |
}, | |
"sort": [{ | |
"counts.count": { | |
"order":"asc", | |
"mode": "max", | |
"nested_path": "counts" | |
"nested_filter": { | |
"bool": { | |
"must": { | |
"match": { | |
"counts.date":"2016-07-01T07:00:00.000Z" | |
} | |
} | |
} | |
} | |
} | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Die Intention des Query ist es alle Artikel nach den Counts am 01.07.2016 um 07:00 zu sortieren