org.elasticsearch.index.query.NestedFilterBuilder Java Examples

The following examples show how to use org.elasticsearch.index.query.NestedFilterBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EsQueryVistor.java    From usergrid with Apache License 2.0 3 votes vote down vote up
/**
 * Generate the field name term for the field name for filters
 */
private NestedFilterBuilder fieldNameTerm( final String fieldName, final FilterBuilder fieldValueBuilder ) {

    final BoolFilterBuilder booleanQuery = FilterBuilders.boolFilter();

    booleanQuery.must( FilterBuilders.termFilter( IndexingUtils.FIELD_NAME_NESTED, fieldName ) );

    booleanQuery.must( fieldValueBuilder );


    return FilterBuilders.nestedFilter( IndexingUtils.ENTITY_FIELDS, booleanQuery );
}