Search in sources :

Example 1 with SearchController

use of org.jbei.ice.lib.search.SearchController in project ice by JBEI.

the class Entries method getSearchResults.

protected List<Long> getSearchResults(SearchQuery searchQuery) {
    SearchController searchController = new SearchController();
    SearchResults searchResults = searchController.runSearch(userId, searchQuery);
    // todo : inefficient: have search return ids only
    List<Long> results = new LinkedList<>();
    for (SearchResult result : searchResults.getResults()) {
        results.add(result.getEntryInfo().getId());
    }
    return results;
}
Also used : SearchResult(org.jbei.ice.lib.dto.search.SearchResult) SearchResults(org.jbei.ice.lib.dto.search.SearchResults) SearchController(org.jbei.ice.lib.search.SearchController) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)1 SearchResult (org.jbei.ice.lib.dto.search.SearchResult)1 SearchResults (org.jbei.ice.lib.dto.search.SearchResults)1 SearchController (org.jbei.ice.lib.search.SearchController)1