make sure all IndexSearcher instances use an executor #4008
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For multi-segment indexes, it is desirable to use
IndexSearcher
with an executor so that the segments can be search in parallel.This change addresses both indexer and webapp. For the former, the threads created should respect indexing parallelism level, for the latter the already existing search executor fixed thread pool should be used.
In a way this fixes the situation with
ThreadpoolSearcherFactory
- even though it is used to createIndexSearcher
objects with a executor, these objects are not really used for searching (see #4009).I verified with debugger/decompiler in IDEA that UI based searches that go through
SearchHelper
end up in the Lucene'ssearch()
method that actually submits tasks to the executor (based on leaves of theIndexReaderContext
object associated with givenIndexSearcher
).Complements PR #3983.