Created
November 21, 2013 15:42
-
-
Save mikebaldry/7583901 to your computer and use it in GitHub Desktop.
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": { | |
"_script": { | |
"script": "long lowestPublishedAt; for (int i = 0; i < _source.sources.size(); i++) { Boolean foundInList = false; for (int x = 0; x < external_ids.size(); x++) { if (external_ids[x] == _source.sources[i].external_id) { foundInList = true; break; } } if (foundInList) { if (i == 0 || _source.sources[i].published_at < lowestPublishedAt) { lowestPublishedAt = _source.sources[i].published_at; } } } return lowestPublishedAt;", | |
"type": "number", | |
"params": { | |
"external_ids": [ | |
"a99240f3", | |
"a217f93" | |
] | |
}, | |
"order": "asc" | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment