Skip to content

Instantly share code, notes, and snippets.

@devrimbaris
Created January 23, 2018 06:18
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 devrimbaris/f49aacb5c9b0ec5b353e8d9e85331bb9 to your computer and use it in GitHub Desktop.
Save devrimbaris/f49aacb5c9b0ec5b353e8d9e85331bb9 to your computer and use it in GitHub Desktop.
[elasticsearch] scripted field query
{
"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