Skip to content

Commit

Permalink
branch-2.1:[fix] (inverted index) Fix UTF-8 4-byte truncation issue a…
Browse files Browse the repository at this point in the history
…nd add configuration to control correct term writing (#48657) (#48741)

Cherry-picked from #48657
  • Loading branch information
airborne12 authored Mar 6, 2025
1 parent 661eba5 commit 3f684f2
Show file tree
Hide file tree
Showing 5 changed files with 822 additions and 1 deletion.
1 change: 1 addition & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,7 @@ DEFINE_String(inverted_index_searcher_cache_limit, "10%");
// set `true` to enable insert searcher into cache when write inverted index data
DEFINE_Bool(enable_write_index_searcher_cache, "true");
DEFINE_Bool(enable_inverted_index_cache_check_timestamp, "true");
DEFINE_mBool(enable_inverted_index_correct_term_write, "true");
DEFINE_Int32(inverted_index_fd_number_limit_percent, "20"); // 20%
DEFINE_Int32(inverted_index_query_cache_shards, "256");

Expand Down
1 change: 1 addition & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@ DECLARE_String(inverted_index_searcher_cache_limit);
// set `true` to enable insert searcher into cache when write inverted index data
DECLARE_Bool(enable_write_index_searcher_cache);
DECLARE_Bool(enable_inverted_index_cache_check_timestamp);
DECLARE_mBool(enable_inverted_index_correct_term_write);
DECLARE_Int32(inverted_index_fd_number_limit_percent); // 50%
DECLARE_Int32(inverted_index_query_cache_shards);

Expand Down
1 change: 1 addition & 0 deletions be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class InvertedIndexColumnWriterImpl : public InvertedIndexColumnWriter {
index_writer->setMaxFieldLength(MAX_FIELD_LEN);
index_writer->setMergeFactor(MERGE_FACTOR);
index_writer->setUseCompoundFile(false);
index_writer->setEnableCorrectTermWrite(config::enable_inverted_index_correct_term_write);

return Status::OK();
}
Expand Down
Loading

0 comments on commit 3f684f2

Please sign in to comment.