Skip to content
Merged
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
14 changes: 10 additions & 4 deletions be/src/olap/rowset/segment_v2/inverted_index_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,12 @@ Status FullTextIndexReader::query(OlapReaderStatistics* stats, RuntimeState* run
"inverted index path: {} not exist.", index_file_path.string());
}

InvertedIndexCacheHandle inverted_index_cache_handle;
static_cast<void>(InvertedIndexSearcherCache::instance()->get_index_searcher(
_fs, index_dir.c_str(), index_file_name, &inverted_index_cache_handle, stats));
auto index_searcher = inverted_index_cache_handle.get_index_searcher();
auto get_index_search = [this, &index_dir, &index_file_name, &stats]() {
InvertedIndexCacheHandle inverted_index_cache_handle;
static_cast<void>(InvertedIndexSearcherCache::instance()->get_index_searcher(
_fs, index_dir.c_str(), index_file_name, &inverted_index_cache_handle, stats));
return inverted_index_cache_handle.get_index_searcher();
};

std::unique_ptr<lucene::search::Query> query;
std::wstring field_ws = std::wstring(column_name.begin(), column_name.end());
Expand Down Expand Up @@ -323,6 +325,8 @@ Status FullTextIndexReader::query(OlapReaderStatistics* stats, RuntimeState* run
} else {
stats->inverted_index_query_cache_miss++;

auto index_searcher = get_index_search();

term_match_bitmap = std::make_shared<roaring::Roaring>();

Status res = Status::OK();
Expand Down Expand Up @@ -371,6 +375,8 @@ Status FullTextIndexReader::query(OlapReaderStatistics* stats, RuntimeState* run
} else {
stats->inverted_index_query_cache_miss++;

auto index_searcher = get_index_search();

term_match_bitmap = std::make_shared<roaring::Roaring>();
// unique_ptr with custom deleter
std::unique_ptr<lucene::index::Term, void (*)(lucene::index::Term*)> term {
Expand Down