How to combine multiple filters aggregation in Elasticsearch? -


i using elasticsearch 5.3. in java client, want use filters on multiple fields using and logic single bucket. currently, filter aggregation supports single termquery. how code multiple termquery in java client?

aggregationbuilders.filter("specific_session", querybuilders.termquery(field_session_id, sessionid)); 

you need use bool query that:

boolquerybuilder filters = querybuilders.boolquery()    .filter(querybuilders.termquery(field_session_id, sessionid))    .filter(querybuilders.termquery(field_xyz, xyz));  aggregationbuilders.filter("specific_session", filters); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -