@Override
    public Result search(Query query, Execution execution) {
        Optional<ErrorMessage> e = validate(query);
        return e.isEmpty() ? execution.search(query) : new Result(query, e.get());
    }
Validates any NearestNeighborItem query items.

@author arnej
container-search/src/main/java/com/yahoo/search/searchers/ValidateNearestNeighborSearcher.java