if (methodName.equals("termFreqs")) {
return new DefaultTermFreqsMethod(methodName, compass, grailsApplication, getDefaultOptions(methodName));
}
if (methodName.equals("search")) {
DefaultSearchMethod searchMethod = new DefaultSearchMethod(methodName, compass, grailsApplication, this, getDefaultOptions(methodName));
searchMethod.setCompassQueryBuilder(new DefaultSearchableCompassQueryBuilder(compass));
searchMethod.getDefaultOptions().put("result", "searchResult");
return searchMethod;
}
if (methodName.equals("moreLikeThis")) {
DefaultSearchMethod searchMethod = new DefaultSearchMethod(methodName, compass, grailsApplication, this, getDefaultOptions(methodName));
searchMethod.setCompassQueryBuilder(new MoreLikeThisCompassQueryBuilder(compass));
searchMethod.getDefaultOptions().put("result", "searchResult");
return searchMethod;
}
if (methodName.equals("countHits")) {
DefaultSearchMethod searchMethod = new DefaultSearchMethod(methodName, compass, grailsApplication, this, getDefaultOptions(methodName));
searchMethod.setCompassQueryBuilder(new DefaultSearchableCompassQueryBuilder(compass));
searchMethod.setHitCollector(new CountOnlyHitCollector());
searchMethod.setSearchResultFactory(new SearchableHitsOnlySearchResultFactory());
return searchMethod;
}
if (methodName.equals("searchTop")) {
DefaultSearchMethod searchMethod = new DefaultSearchMethod(methodName, compass, grailsApplication, this, getDefaultOptions(methodName));
searchMethod.setCompassQueryBuilder(new DefaultSearchableCompassQueryBuilder(compass));
searchMethod.setHitCollector(new DefaultSearchableTopHitCollector());
searchMethod.setSearchResultFactory(new SearchableHitsOnlySearchResultFactory());
return searchMethod;
}
if (methodName.equals("searchEvery")) {
DefaultSearchMethod searchMethod = new DefaultSearchMethod(methodName, compass, grailsApplication, this, getDefaultOptions(methodName));
searchMethod.setCompassQueryBuilder(new DefaultSearchableCompassQueryBuilder(compass));
searchMethod.setHitCollector(new DefaultSearchableEveryHitCollector());
searchMethod.setSearchResultFactory(new SearchableHitsOnlySearchResultFactory());
return searchMethod;
}
if (methodName.equals("suggestQuery")) {
DefaultSuggestQueryMethod suggestQueryMethod = new DefaultSuggestQueryMethod(methodName, compass, grailsApplication, getDefaultOptions(methodName));
suggestQueryMethod.setCompassQueryBuilder(new DefaultSearchableCompassQueryBuilder(compass));