Like a blog with the related article section, how to find document related to another document by proximity.
For my application, written in Ruby, i use Tire client to communicate with elasticsearch.
I believe that you're looking for "more like this" querying - here's the ES API documentation: http://www.elasticsearch.org/guide/reference/api/more-like-this/.
I'd think that tire
exposes this API endpoint or allows you to do so manually - in fact, it looks like tire-contrib
give you what you're looking for: https://github.com/karmi/tire-contrib/.