Skip to content

Commit 2dc4040

Browse files
visualYJDyuhaijun999
authored andcommitted
[fix][store] Null values are excluded from the tantivy index.
1 parent e557a8d commit 2dc4040

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/document/document_index.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,12 @@ butil::Status DocumentIndex::Add(const std::vector<pb::common::DocumentWithId>&
245245
uint64_t document_id = document_with_id.id();
246246

247247
const auto& document = document_with_id.document();
248+
248249
for (const auto& [field_name, document_value] : document.document_data()) {
250+
// skip the field which not set
251+
if (document_value.field_value().data_case() == pb::common::ScalarField::DATA_NOT_SET) {
252+
continue;
253+
}
249254
switch (document_value.field_type()) {
250255
case pb::common::ScalarFieldType::STRING:
251256
text_column_names.push_back(field_name);

0 commit comments

Comments
 (0)