Skip to content

Commit

Permalink
Move buildQuery so that the index searcher is released during excepti…
Browse files Browse the repository at this point in the history
…on (#989)

Co-authored-by: Bryan Burkholder <[email protected]>
  • Loading branch information
bryanlb and bryanlb authored Jul 12, 2024
1 parent 1e91dad commit 30a66a0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ public SearchResult<LogMessage> search(
// Acquire an index searcher from searcher manager.
// This is a useful optimization for indexes that are static.
IndexSearcher searcher = searcherManager.acquire();

Query query =
openSearchAdapter.buildQuery(
dataset, queryStr, startTimeMsEpoch, endTimeMsEpoch, searcher);
try {
List<LogMessage> results;
InternalAggregation internalAggregation = null;
Query query =
openSearchAdapter.buildQuery(
dataset, queryStr, startTimeMsEpoch, endTimeMsEpoch, searcher);

if (howMany > 0) {
CollectorManager<TopFieldCollector, TopFieldDocs> topFieldCollector =
Expand Down

0 comments on commit 30a66a0

Please sign in to comment.