docs: static SearchRequestBuilder applyAliasMetadata(EsMajorVersion version,
                                                     Map<String, IndicesAliases.Alias> aliases,
                                                     SearchRequestBuilder searchRequestBuilder,
                                                     String index, String... indicesOrAliases) {
          if (QueryUtils.isExplicitlyRequested(index, indicesOrAliases)) {
              return searchRequestBuilder;
          }
  
          Set<String> routing = new HashSet<String>();
          List<QueryBuilder> aliasFilters = new ArrayList<QueryBuilder>();
          for (IndicesAliases.Alias alias : aliases.values()) {
              if (QueryUtils.isExplicitlyRequested(alias.getName(), indicesOrAliases)) {
                  // The alias is explicitly requested
                  if (StringUtils.hasLength(alias.getSearchRouting())) {
                      for (String value : alias.getSearchRouting().split(",")) {
                          routing.add(value.trim());
                      }
                  }
                  if (alias.getFilter() != null) {
                      try {
                          aliasFilters.add(new RawQueryBuilder(alias.getFilter(), false));
                      } catch (IOException e) {
                          throw new EsHadoopIllegalArgumentException("Failed to parse alias filter: [" + alias.getFilter() + "]");
                      }
                  }
              }
          }
          if (aliasFilters.size() > 0) {
              QueryBuilder aliasQuery;
              if (aliasFilters.size() == 1) {
                  aliasQuery = aliasFilters.get(0);
              } else {
                  aliasQuery = new BoolQueryBuilder();
                  for (QueryBuilder filter : aliasFilters) {
                      ((BoolQueryBuilder) aliasQuery).should(filter);
                  }
              }
              if (searchRequestBuilder.query() == null) {
                  searchRequestBuilder.query(aliasQuery);
              } else {
                  BoolQueryBuilder mainQuery = new BoolQueryBuilder();
                  mainQuery.must(searchRequestBuilder.query());
                  if (version.after(EsMajorVersion.V_1_X)) {
                      mainQuery.filter(aliasQuery);
                  } else {
                      mainQuery.must(new ConstantScoreQueryBuilder().filter(aliasQuery).boost(0.0f));
                  }
                  searchRequestBuilder.query(mainQuery);
              }
          }
          if (routing.size() > 0) {
              searchRequestBuilder.routing(StringUtils.concatenate(routing, ","));
          }
          return searchRequestBuilder;
      }