private ErrorMessage validate(Query query) {
        String attribute = query.getRanking().getMatchPhase().getAttribute();
        if ( attribute != null && ! validMatchPhaseAttributes.contains(attribute) ) {
            return ErrorMessage.createInvalidQueryParameter("The attribute '" + attribute + "' is not available for match-phase. " +
                                                            "It must be a single value numeric attribute with fast-search.");
        }
        attribute = query.getRanking().getMatchPhase().getDiversity().getAttribute();
        if (attribute != null && ! validDiversityAttributes.contains(attribute)) {
            return ErrorMessage.createInvalidQueryParameter("The attribute '" + attribute + "' is not available for match-phase diversification. " +
                    "It must be a single value numeric or string attribute.");
        }
        return null;
    }
Validates that the attribute given as match-phase override is actually a valid numeric attribute
with fast-search enabled.

@author baldersheim
container-search/src/main/java/com/yahoo/search/searchers/ValidateMatchPhaseSearcher.java