byte[] data = json.writeValueAsBytes(article);
node.client().prepareIndex(INDEX, TYPE, article.getSlug()).setSource(data).execute().actionGet();
}
public List<Article> findBySlugAndText(String slug, String text) {
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
boolQuery.should(QueryBuilders.textQuery("slug", slug));
boolQuery.should(QueryBuilders.textQuery("text", text));
SearchResponse searchResponse = node.client().prepareSearch(INDEX).setTypes(TYPE).
addSort("dateCreated", SortOrder.DESC).
setFilter(getNowDateFilter()).
setQuery(boolQuery).execute().actionGet();