SolrOperations solrOperations = selectSolrOperations(metadata);
if (namedQueries.hasQuery(namedQueryName)) {
String namedQuery = namedQueries.getQuery(namedQueryName);
return new StringBasedSolrQuery(namedQuery, queryMethod, solrOperations);
} else if (queryMethod.hasAnnotatedQuery()) {
return new StringBasedSolrQuery(queryMethod, solrOperations);
} else {
return new PartTreeSolrQuery(queryMethod, solrOperations);
}
}