At the moment, these types of queries are tough for Elasticsearch. Event X may be located on one shard, while Event Y may be on a different shard. Matching/sorting based on sequential causality would mean that both shards (on potentially different nodes) would have to coordinate their actions and communicate, which could be very expensive.
You might be able to accomplish something similar with the new pipeline aggregations, but not likely. These aggs work on the results of other aggregations (e.g. they operate on buckets, not documents), so you'd only be able to calculate stats on the sampled buckets.
You'll probably have better luck by designing some kind of "entity-centric indexing" scheme, where you save the sequential relationship in an "entity" and use that document to determine matches. Mark Harwood has a few presentations on the subject: