}
if (aliases.length == 1) {
IndexAlias indexAlias = alias(aliases[0]);
if (indexAlias == null) {
// This shouldn't happen unless alias disappeared after filteringAliases was called.
throw new InvalidAliasNameException(index, aliases[0], "Unknown alias name was passed to alias Filter");
}
return indexAlias.parsedFilter();
} else {
// we need to bench here a bit, to see maybe it makes sense to use OrFilter
XBooleanFilter combined = new XBooleanFilter();
for (String alias : aliases) {
IndexAlias indexAlias = alias(alias);
if (indexAlias == null) {
// This shouldn't happen unless alias disappeared after filteringAliases was called.
throw new InvalidAliasNameException(index, aliases[0], "Unknown alias name was passed to alias Filter");
}
if (indexAlias.parsedFilter() != null) {
combined.add(new FilterClause(indexAlias.parsedFilter(), BooleanClause.Occur.SHOULD));
} else {
// The filter might be null only if filter was removed after filteringAliases was called