'From a list of FeedItems with normalized feed element IDs,
return an ES query that fetches the feed elements for each feed item.'

def get_es_feed_element_query(self, sq, feed_items):

    filters = []
    for feed_item in feed_items:
        item_type = feed_item['item_type']
        filters.append(es_filter.Bool(must=[es_filter.Term(id=feed_item[item_type]), es_filter.Term(item_type=item_type)]))
    return sq.filter(es_filter.Bool(should=filters))[0:len(feed_items)]
