//QUERY IN ES
{
"size": 100, //default 10
"from": 0, //default 0
"query":
{
"match_all": {}
},
"filter" : {
"term" : {
"activated" : "true"
}
}
}
//QUERY IN JAVA
FilteredQueryBuilder builder =
QueryBuilders.filteredQuery(QueryBuilders.termQuery("test",
"test"),FilterBuilders.termFilter("key","value"));
FilteredQueryBuilder builder = QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(),
FilterBuilders.termFilter("username","stackoverflow"));
ClientConfiguration clientConfiguration =
ClientConfiguration.builder().connectedTo("localhost:9200").build();
RestHighLevelClient client = RestClients.create(clientConfiguration).rest();