code: public List<SearchResult> search(Query query,
                                       Sort sort,
                                       SearchResult after,
                                       Integer count,
                                       Set<String> fieldsToLoad,
                                       boolean usesRelevance) {
          Log.debug("Searching by query %s", query);
          try {
              IndexSearcher searcher = searcherManager.acquire();
              try {
                  // Search
                  ScoreDoc start = after == null ? null : after.getScoreDoc();
                  TopDocs topDocs = topDocs(searcher, query, sort, start, count, usesRelevance);
                  ScoreDoc[] scoreDocs = topDocs.scoreDocs;
  
                  // Collect the documents from query result
                  List<SearchResult> searchResults = new ArrayList<>(scoreDocs.length);
                  for (ScoreDoc scoreDoc : scoreDocs) {
                      Document document = searcher.doc(scoreDoc.doc, fieldsToLoad);
                      SearchResult searchResult = rowMapper.searchResult(document, scoreDoc);
                      searchResults.add(searchResult);
                  }
  
                  return searchResults;
              } finally {
                  searcherManager.release(searcher);
              }
          } catch (IOException e) {
              Log.error(e, "Error while searching by query %s", query);
              throw new RuntimeException(e);
          }
      }
docs: Finds the top {@code count} hits for {@code query}, applying {@code clusteringKeyFilter} if non-null, and sorting
  the hits by the criteria in {@code sortFields}.
  
  @param query        The {@link Query} to search for.
  @param sort         The {@link Sort} to be applied.
  @param after        The starting {@link SearchResult}.
  @param count        Return only the top {@code count} results.
  @param fieldsToLoad The name of the fields to be loaded.
  @return The found documents, sorted according to the supplied {@link Sort} instance.