private SearchRequestBuilder createFrequentlyRelatedContentSearch(RelatedItemSearch search, Client searchClient) {
        SearchRequestBuilder sr = searchClient.prepareSearch();
        sr.internalBuilder(builder.createFrequentlyRelatedContentSearch(search));
        sr.setIndices(indexName);
        return sr;

    }
private SearchRequestBuilder createFrequentlyRelatedContentSearch ( RelatedItemSearch search , Client searchClient ) { SearchRequestBuilder sr = searchClient . prepareSearch ( ) ; sr . internalBuilder ( builder . createFrequentlyRelatedContentSearch ( search ) ) ; sr . setIndices ( indexName ) ; return sr ; }
/*
Creates a query like:

{
"size" : 0,
"timeout" : 5000,
"query" : {
"constant_score" : {
"filter" : {
"bool" : {
"must" : [ {
"term" : {
"related-with" : "apparentice you're hired"
}
}, {
"term" : {
"channel" : "bbc"
}
} ]
}
}
}
},
"facets" : {
"frequently-related-with" : {
"terms" : {
"field" : "id",
"size" : 5,
"execution_hint" : "map"
}
}
}
}