This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new cae76a88500 [opt](inverted index) Add null document interface to
optimize empty string indexing (#28661) (#28978)
cae76a88500 is described below
commit cae76a88500b67cebd14e618e8ed271ffd1cc729
Author: qiye <[email protected]>
AuthorDate: Mon Dec 25 19:19:39 2023 +0800
[opt](inverted index) Add null document interface to optimize empty string
indexing (#28661) (#28978)
---
be/src/olap/rowset/segment_v2/inverted_index_writer.cpp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
index 44d03723b15..18f7f7ccc5e 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
@@ -229,6 +229,17 @@ public:
return Status::OK();
}
+ Status add_null_document() {
+ try {
+ _index_writer->addNullDocument(_doc.get());
+ } catch (const CLuceneError& e) {
+ _dir->deleteDirectory();
+ return Status::Error<ErrorCode::INVERTED_INDEX_CLUCENE_ERROR>(
+ "CLuceneError add_null_document: {}", e.what());
+ }
+ return Status::OK();
+ }
+
Status add_nulls(uint32_t count) override {
_null_bitmap.addRange(_rid, _rid + count);
_rid += count;
@@ -241,7 +252,7 @@ public:
for (int i = 0; i < count; ++i) {
new_fulltext_field(empty_value.c_str(), 0);
- RETURN_IF_ERROR(add_document());
+ RETURN_IF_ERROR(add_null_document());
}
}
return Status::OK();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]