Skip to content

Commit

Permalink
[opt](invert index) Empty strings are not written to the index in the…
Browse files Browse the repository at this point in the history
… case of TOKENIZED
  • Loading branch information
zzzxl1993 committed Dec 21, 2023
1 parent 4ddef31 commit f659e47
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ class InvertedIndexColumnWriterImpl : public InvertedIndexColumnWriter {
<< "value length:" << v->get_size() << ", ignore this value";
new_fulltext_field(empty_value.c_str(), 0);
RETURN_IF_ERROR(add_null_document());
} else if (_parser_type != InvertedIndexParserType::PARSER_NONE && v->empty()) {
new_fulltext_field(empty_value.c_str(), 0);
RETURN_IF_ERROR(add_null_document());
} else {
new_fulltext_field(v->get_data(), v->get_size());
RETURN_IF_ERROR(add_document());
Expand Down Expand Up @@ -354,6 +357,9 @@ class InvertedIndexColumnWriterImpl : public InvertedIndexColumnWriter {
<< "value length:" << value.length() << ", ignore this value";
new_fulltext_field(empty_value.c_str(), 0);
RETURN_IF_ERROR(add_null_document());
} else if (_parser_type != InvertedIndexParserType::PARSER_NONE && v->empty()) {
new_fulltext_field(empty_value.c_str(), 0);
RETURN_IF_ERROR(add_null_document());
} else {
new_fulltext_field(value.c_str(), value.length());
RETURN_IF_ERROR(add_document());
Expand Down

0 comments on commit f659e47

Please sign in to comment.