Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ua/org.eclipse.help.base/preferences.ini
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ maxConnections=10
# Example: maxTopics=
maxTopics=500

# Max number of topics to be searched for before filtering is applied
# If the number is too small, hits may be missed when searching e.g. in a topic and its subtopics
# The higher the number, the slightly worse the performance
# Assign a value greater than maxTopics (see above), but no greater than Integer.MAX_VALUE
maxHitsBeforeFiltering=1000

#########################
# Search Results
#########################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
*/
public class SearchIndex implements IHelpSearchIndex {

private static final int MAX_HITS_BEFORE_FILTERING = Platform.getPreferencesService()
.getInt(HelpBasePlugin.PLUGIN_ID, "maxHitsBeforeFiltering", 1_000, null); //$NON-NLS-1$

private IndexReader ir;

private IndexWriter iw;
Expand Down Expand Up @@ -662,7 +665,7 @@ public void search(ISearchQuery searchQuery, ISearchHitCollector collector) thro
}
if (luceneQuery == null)
return;
TopDocs topDocs = searcher.search(luceneQuery, 1000);
TopDocs topDocs = searcher.search(luceneQuery, MAX_HITS_BEFORE_FILTERING);
collector.addHits(LocalSearchManager.asList(topDocs, searcher), queryBuilder.gethighlightTerms());
} catch (IndexSearcher.TooManyClauses tmc) {
collector.addQTCException(new QueryTooComplexException());
Expand Down
Loading