Skip to content

Commit

Permalink
display all results
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Dec 14, 2017
1 parent a41d0b5 commit bd48a4c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion search/src/main/java/search/SearchUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ public static List<SearchedResult> executeSearch(String searchText, String searc
try {
Query query = buildQuery(searchText, searchField);
searcher = getSearcher();
TopDocs topDocs = getTopDocs(searcher, query, 100);
TopDocs topDocs = getTopDocs(searcher, query, 50);
int totalHits = topDocs.totalHits;
if (totalHits > 50) {
topDocs = getTopDocs(searcher, query, totalHits);
}
List<Document> documentList = getDocumentListByScoreDocs(topDocs.scoreDocs);
List<String> contextList = getContextListByTopDocs(query, topDocs, searcher);
for (int i = 0; i < documentList.size(); i++) {
Expand Down

0 comments on commit bd48a4c

Please sign in to comment.