implement elasticsearch filter in java

Solutions on MaxInterview for implement elasticsearch filter in java by the best coders in the world

showing results for - "implement elasticsearch filter in java"
Federico
20 Jan 2019
1//QUERY IN ES
2{
3  "size": 100, //default 10
4  "from": 0, //default 0
5  "query":
6   {
7    "match_all": {}
8   },
9   "filter" : {
10        "term" : { 
11            "activated" : "true" 
12        }
13    }
14}  
15
16
17//QUERY IN JAVA
18FilteredQueryBuilder builder = 
19 QueryBuilders.filteredQuery(QueryBuilders.termQuery("test", 
20 "test"),FilterBuilders.termFilter("key","value"));
Mads
29 Aug 2018
1FilteredQueryBuilder builder = QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(),
2   FilterBuilders.termFilter("username","stackoverflow"));