Source:
protected FilterBuilder getFilterForHasAuthorizationContainer(HasAuthorizationContainer hasAuthorization) { PropertyNameVisibilitiesStore visibilitiesStore = getSearchIndex().getPropertyNameVisibilitiesStore(); Authorizations auths = getParameters().getAuthorizations(); Graph graph = getGraph(); Set<String> hashes = StreamSupport.stream(hasAuthorization.getAuthorizations().spliterator(), false) .flatMap(authorization -> visibilitiesStore.getHashesWithAuthorization(graph, authorization, auths).stream()) .collect(Collectors.toSet()); List<FilterBuilder> filters = new ArrayList<>(); for (PropertyDefinition propertyDefinition : graph.getPropertyDefinitions()) { String propertyName = propertyDefinition.getPropertyName(); Set<String> matchingPropertyHashes = visibilitiesStore.getHashes(graph, propertyName, auths).stream() .filter(hashes::contains) .collect(Collectors.toSet()); for (String fieldName : getSearchIndex().addHashesToPropertyName(propertyName, matchingPropertyHashes)) { filters.add(FilterBuilders.existsFilter(fieldName)); } } Collection<String> elementTypeHashes = visibilitiesStore.getHashes(graph, ElasticsearchSingleDocumentSearchIndex.ELEMENT_TYPE_FIELD_NAME, auths); Collection<String> matchingElementTypeHashes = elementTypeHashes.stream().filter(hashes::contains).collect(Collectors.toSet()); for (String elementTypeFieldName : getSearchIndex().addHashesToPropertyName(ElasticsearchSingleDocumentSearchIndex.ELEMENT_TYPE_FIELD_NAME, matchingElementTypeHashes)) { filters.add(FilterBuilders.existsFilter(elementTypeFieldName)); } if (filters.isEmpty()) { throw new VertexiumNoMatchingPropertiesException(Joiner.on(", ").join(hasAuthorization.getAuthorizations())); } return getSingleFilterOrOrTheFilters(filters, hasAuthorization); }

Target:
protected FilterBuilder getFilterForHasAuthorizationContainer(HasAuthorizationContainer hasAuthorization) { PropertyNameVisibilitiesStore visibilitiesStore = getSearchIndex().getPropertyNameVisibilitiesStore(); Authorizations auths = getParameters().getAuthorizations(); Graph graph = getGraph(); Set<String> hashes = StreamUtils.stream(hasAuthorization.getAuthorizations()) .flatMap(authorization -> visibilitiesStore.getHashesWithAuthorization(graph, authorization, auths).stream()) .collect(Collectors.toSet()); List<FilterBuilder> filters = new ArrayList<>(); for (PropertyDefinition propertyDefinition : graph.getPropertyDefinitions()) { String propertyName = propertyDefinition.getPropertyName(); Set<String> matchingPropertyHashes = visibilitiesStore.getHashes(graph, propertyName, auths).stream() .filter(hashes::contains) .collect(Collectors.toSet()); for (String fieldName : getSearchIndex().addHashesToPropertyName(propertyName, matchingPropertyHashes)) { filters.add(FilterBuilders.existsFilter(fieldName)); } } Collection<String> elementTypeHashes = visibilitiesStore.getHashes(graph, ElasticsearchSingleDocumentSearchIndex.ELEMENT_TYPE_FIELD_NAME, auths); Collection<String> matchingElementTypeHashes = elementTypeHashes.stream().filter(hashes::contains).collect(Collectors.toSet()); for (String elementTypeFieldName : getSearchIndex().addHashesToPropertyName(ElasticsearchSingleDocumentSearchIndex.ELEMENT_TYPE_FIELD_NAME, matchingElementTypeHashes)) { filters.add(FilterBuilders.existsFilter(elementTypeFieldName)); } if (filters.isEmpty()) { throw new VertexiumNoMatchingPropertiesException(Joiner.on(", ").join(hasAuthorization.getAuthorizations())); } return getSingleFilterOrOrTheFilters(filters, hasAuthorization); }