Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

implement elasticsearch filter in java

//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"));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #implement #elasticsearch #filter #java
ADD COMMENT
Topic
Name
4+9 =