This is an automated email from the ASF dual-hosted git repository.
jianliangqi pushed a commit to branch clucene-2.0
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/clucene-2.0 by this push:
new c5e27ad6 [fix](compile) fix clucene-2.0 compile error (#149)
c5e27ad6 is described below
commit c5e27ad6cd03dcbbb9d3c41ff6a5dfb05d05d33b
Author: zzzxl <[email protected]>
AuthorDate: Thu Dec 14 15:57:04 2023 +0800
[fix](compile) fix clucene-2.0 compile error (#149)
* [feature](input) Add the file cache interface (#142)
* [Update](cmake) add debug and no omit frame flags for clucene compilation
(#143)
* [fix](reader)fFig file descriptor (fd) leak issu. (#144)
* [optimize](reader) optimize the tii, tis file structure (#146)
* [Fix](PFOR) fix DefaultDDEC (#147)
* [fix](index dict) fix index compaction to write the .tis and .tii file
structures (#148)
---------
Co-authored-by: airborne12 <[email protected]>
---
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]