You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on PR #4008, I noticed that the MultiReader wrapping basically ignores the IndexSearcher objects, even for single project searches. Basically RuntimeEnvironment keeps the IndexSearcher objects in a map that is then used solely to get IndexReader objects (out of IndexSearcher objects) in order to create new IndexSearcher instance, outside of ThreadpoolSearcherFactory.
Also, project-less setup might want to leverage the SearcherManager approach too - to avoid opening the index directory (supposedly expensive operation) each time a search is performed:
Also, DirectoryHistoryReader should get the IndexReader objects from the SearcherManagers in RuntimeEnvironment and avoid IndexDatabase#getIndexReader(). Actually, it is IndexDatabase#getIndexReader() that should be replaced. This is an area (IndexDatabase#getDocument()) where IndexSearcher from the SearcherManager should be used (via RuntimeEnvironment.getInstance().getIndexSearcher(String projectName)), i.e. avoid creating new one. IndexDatabase#getDocument() is actually used pretty heavily in the webapp (to get the most recent revision of given document in order to construct URL for the redirect) so this might provide some speedup.
When working on PR #4008, I noticed that the
MultiReader
wrapping basically ignores theIndexSearcher
objects, even for single project searches. BasicallyRuntimeEnvironment
keeps theIndexSearcher
objects in a map that is then used solely to getIndexReader
objects (out ofIndexSearcher
objects) in order to create newIndexSearcher
instance, outside ofThreadpoolSearcherFactory
.Also, project-less setup might want to leverage the
SearcherManager
approach too - to avoid opening the index directory (supposedly expensive operation) each time a search is performed:opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/web/SearchHelper.java
Lines 383 to 389 in c3b0c92
The text was updated successfully, but these errors were encountered: