This is an automated email from the ASF dual-hosted git repository.
jianliangqi pushed a commit to branch clucene
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/clucene by this push:
new d6adff12 [fix](index dict) fix index compaction to write the .tis and
.tii file structures (#148)
d6adff12 is described below
commit d6adff12de6a687666edbc77ad8da6ec1ab32b88
Author: zzzxl <[email protected]>
AuthorDate: Thu Dec 14 14:43:17 2023 +0800
[fix](index dict) fix index compaction to write the .tis and .tii file
structures (#148)
---
src/core/CLucene/index/TermInfosWriter.cpp | 16 ++++++++++++----
src/core/CLucene/index/_TermInfosWriter.h | 3 ++-
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/core/CLucene/index/TermInfosWriter.cpp
b/src/core/CLucene/index/TermInfosWriter.cpp
index b6a45d7d..d22f04c5 100644
--- a/src/core/CLucene/index/TermInfosWriter.cpp
+++ b/src/core/CLucene/index/TermInfosWriter.cpp
@@ -410,11 +410,19 @@ void TermInfosWriter::close() {
//Func - Closes the TermInfosWriter
//Pre - true
//Post - The TermInfosWriter has been closed
-
if (output) {
- //write size at start
- //output->seek(4); // write size after format
- output->writeLong(size);// do not seek now, directly write size at
file footer
+ if (FORMAT == -4) {
+ output->writeLong(size);
+ if (!isIndex) {
+ other->tisSize = size;
+ } else {
+ output->writeLong(tisSize);
+ }
+ } else {
+ //write size at start
+ //output->seek(4); // write size after format
+ output->writeLong(size);// do not seek now, directly write size at
file footer
+ }
output->close();
_CLDELETE(output);
diff --git a/src/core/CLucene/index/_TermInfosWriter.h
b/src/core/CLucene/index/_TermInfosWriter.h
index 3acc2abe..b2063f81 100644
--- a/src/core/CLucene/index/_TermInfosWriter.h
+++ b/src/core/CLucene/index/_TermInfosWriter.h
@@ -73,7 +73,8 @@ private:
FieldInfos *fieldInfos;
CL_NS(store)::IndexOutput *output;
TermInfo *lastTi;
- int64_t size;
+ int64_t size = 0;
+ int64_t tisSize = 0;
int64_t lastIndexPointer;
bool isIndex;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]