Search in sources :

Example 1 with GlossComparator

use of com.tyndalehouse.step.core.service.helpers.GlossComparator in project step by STEPBible.

the class SearchServiceImpl method setDefinitionForResults.

/**
 * Sets the definitions onto the result object
 *
 * @param result             the result object
 * @param lexiconDefinitions the definitions that have been included in the search
 */
private void setDefinitionForResults(final SearchResult result, final List<EntityDoc> lexiconDefinitions, SuggestionType suggestionType) {
    Collections.sort(lexiconDefinitions, new GlossComparator());
    List<LexiconSuggestion> suggestions = new ArrayList(lexiconDefinitions.size());
    for (final EntityDoc def : lexiconDefinitions) {
        suggestions.add(convertToSuggestion(def, null));
    }
    result.setDefinitions(suggestions);
}
Also used : ArrayList(java.util.ArrayList) EntityDoc(com.tyndalehouse.step.core.data.EntityDoc) GlossComparator(com.tyndalehouse.step.core.service.helpers.GlossComparator)

Aggregations

EntityDoc (com.tyndalehouse.step.core.data.EntityDoc)1 GlossComparator (com.tyndalehouse.step.core.service.helpers.GlossComparator)1 ArrayList (java.util.ArrayList)1