Package grails.plugin.searchable.internal.compass.search

Examples of grails.plugin.searchable.internal.compass.search.DefaultSearchMethod$SearchCompassCallback


        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));
View Full Code Here

TOP

Related Classes of grails.plugin.searchable.internal.compass.search.DefaultSearchMethod$SearchCompassCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.