热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.elasticsearch.index.query.FilterBuilders.boolFilter()方法的使用及代码示例

本文整理了Java中org.elasticsearch.index.query.FilterBuilders.boolFilter()方法的一些代码示例,展示了

本文整理了Java中org.elasticsearch.index.query.FilterBuilders.boolFilter()方法的一些代码示例,展示了FilterBuilders.boolFilter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FilterBuilders.boolFilter()方法的具体详情如下:
包路径:org.elasticsearch.index.query.FilterBuilders
类名称:FilterBuilders
方法名:boolFilter

FilterBuilders.boolFilter介绍

暂无

代码示例

代码示例来源:origin: apache/usergrid

final FilterBuilder notFilter = FilterBuilders.boolFilter().mustNot( notFilterBuilder ) ;
final FilterBuilder selectAllFilter = FilterBuilders.boolFilter().must( FilterBuilders.matchAllFilter()) .must( notFilter );
filterBuilders.push( selectAllFilter );

代码示例来源:origin: apache/usergrid

/**
* 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 );
}

代码示例来源:origin: apache/usergrid

final BoolFilterBuilder fb = FilterBuilders.boolFilter().should( leftFilter ).should( rightFilter );
filterBuilders.push( fb );

代码示例来源:origin: apache/usergrid

final BoolFilterBuilder fb = FilterBuilders.boolFilter().must(leftFilter).must(rightFilter);
filterBuilders.push( fb );

代码示例来源:origin: apache/usergrid

BoolFilterBuilder boolQueryFilter = FilterBuilders.boolFilter();

代码示例来源:origin: rmagen/elastic-gremlin

public static BoolFilterBuilder createFilterBuilder(List hasContainers) {
BoolFilterBuilder boolFilter = FilterBuilders.boolFilter();
if(hasContainers != null) hasContainers.forEach(has -> addFilter(boolFilter, has));
return boolFilter;
}

代码示例来源:origin: com.erudika/para

@Override
public

List

findTagged(String appid, String type,
String[] tags, Pager... pager) {
if (tags == null || tags.length == 0 || StringUtils.isBlank(appid)) {
return Collections.emptyList();
}
BoolFilterBuilder tagFilter = FilterBuilders.boolFilter();
//assuming clean & safe tags here
for (String tag : tags) {
tagFilter.must(FilterBuilders.termFilter(Config._TAGS, tag));
}
QueryBuilder qb = QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), tagFilter);
// The filter looks like this: ("tag1" OR "tag2" OR "tag3") AND "type"
return searchQuery(appid, type, qb, pager);
}

代码示例来源:origin: searchisko/elasticsearch-river-jira

@Override
public void buildSearchForIndexedDocumentsNotUpdatedAfter(SearchRequestBuilder srb, String jiraProjectKey, Date date) {
FilterBuilder filterTime = FilterBuilders.rangeFilter("_timestamp").lt(date);
FilterBuilder filterProject = FilterBuilders.termFilter(indexFieldForProjectKey, jiraProjectKey);
FilterBuilder filterSource = FilterBuilders.termFilter(indexFieldForRiverName, riverName);
FilterBuilder filter = FilterBuilders.boolFilter().must(filterTime).must(filterProject).must(filterSource);
srb.setQuery(QueryBuilders.matchAllQuery()).addField("_id").setPostFilter(filter);
Set st = new LinkedHashSet();
st.add(issueTypeName);
if (commentIndexingMode.isExtraDocumentIndexed())
st.add(commentTypeName);
if (changelogIndexingMode.isExtraDocumentIndexed())
st.add(changelogTypeName);
srb.setTypes(st.toArray(new String[st.size()]));
}

代码示例来源:origin: alien4cloud/alien4cloud

/**
* Add a filter that check for authorizations on resources
* Takes also in account the ALL_USER group
*/
public static FilterBuilder getResourceAuthorizationFilters() {
final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (auth.getAuthorities().contains(new SimpleGrantedAuthority(Role.ADMIN.toString()))) {
return null;
}
FilterBuilder filterBuilder;
User user = (User) auth.getPrincipal();
if (user.getGroups() != null && !user.getGroups().isEmpty()) {
filterBuilder = FilterBuilders.boolFilter()
.should(FilterBuilders.nestedFilter("userRoles", FilterBuilders.termFilter("userRoles.key", auth.getName())))
.should(FilterBuilders.nestedFilter("groupRoles", FilterBuilders.inFilter("groupRoles.key", user.getGroups().toArray())));
} else {
filterBuilder = FilterBuilders.nestedFilter("userRoles", FilterBuilders.termFilter("userRoles.key", auth.getName()));
}
Group group = getAllUsersGroup();
if (group != null) {
String groupId = group.getId();
// add ALL_USERS group as OR filter
filterBuilder = FilterBuilders.orFilter(filterBuilder,
FilterBuilders.nestedFilter("groupRoles", FilterBuilders.inFilter("groupRoles.key", groupId)));
}
return filterBuilder;
}

代码示例来源:origin: org.vertexium/vertexium-elasticsearch-singledocument

BoolFilterBuilder elementIsNotHiddenQuery = FilterBuilders.boolFilter();
for (String hiddenVertexPropertyName : hiddenVertexPropertyNames) {
elementIsNotHiddenQuery.mustNot(FilterBuilders.existsFilter(hiddenVertexPropertyName));

代码示例来源:origin: unchartedsoftware/aperture-tiles

BoolFilterBuilder boundaryFilter = FilterBuilders.boolFilter();

推荐阅读
author-avatar
众大文化_724
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有