Skip to content

Commit bd48a4c

Browse files
committed
display all results
1 parent a41d0b5 commit bd48a4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

search/src/main/java/search/SearchUtil.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ public static List<SearchedResult> executeSearch(String searchText, String searc
116116
try {
117117
Query query = buildQuery(searchText, searchField);
118118
searcher = getSearcher();
119-
TopDocs topDocs = getTopDocs(searcher, query, 100);
119+
TopDocs topDocs = getTopDocs(searcher, query, 50);
120+
int totalHits = topDocs.totalHits;
121+
if (totalHits > 50) {
122+
topDocs = getTopDocs(searcher, query, totalHits);
123+
}
120124
List<Document> documentList = getDocumentListByScoreDocs(topDocs.scoreDocs);
121125
List<String> contextList = getContextListByTopDocs(query, topDocs, searcher);
122126
for (int i = 0; i < documentList.size(); i++) {

0 commit comments

Comments
 (0)