List<String> apiRef = splitFilters.get("apiRef");
List<String> otherFacetPaths = splitFilters.get("others");
AndFilterBuilder projectApiRefAnded = new AndFilterBuilder();
if (apiRef.size() > 0) {
projectApiRefAnded.add(new TermsFilterBuilder("facetPaths", apiRef).execution("or"));
}
if (projects.size() > 0) {
projectApiRefAnded.add(new TermsFilterBuilder("facetPaths", projects).execution("or"));
}
OrFilterBuilder outermostFilter = new OrFilterBuilder();
outermostFilter.add(projectApiRefAnded);
if (otherFacetPaths.size() > 0) {
outermostFilter.add(new TermsFilterBuilder("facetPaths", otherFacetPaths).execution("or"));
}
filterBuilder.add(outermostFilter);
}
}