Created
January 23, 2018 06:18
-
-
Save devrimbaris/f49aacb5c9b0ec5b353e8d9e85331bb9 to your computer and use it in GitHub Desktop.
[elasticsearch] scripted field 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
{ | |
"sort" : [ | |
{"processing_end_time" : {"order" :"asc"}} | |
], | |
"query": { | |
"bool" : { | |
"must" :{ | |
"range":{ | |
"ingestion_time": { | |
"gte": "now-1d/d" | |
} | |
} | |
}, | |
"must" : { | |
"script" : { | |
"script" : { | |
"inline": "doc['processing_end_time'].value - doc['ingestion_time'].value > 6000", | |
"lang": "painless" | |
} | |
} | |
} | |
} | |
}, | |
"_source" : ["script", "vin", "gpt", "ingestion_time","processing_end_time"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment