From 4eed76f75dd467d1b10269f05dfdd2763f547b79 Mon Sep 17 00:00:00 2001 From: amorynan Date: Tue, 2 Apr 2024 17:01:43 +0800 Subject: [PATCH] fix field data delete values but not make length reset --- src/core/CLucene/index/SDocumentWriter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/CLucene/index/SDocumentWriter.cpp b/src/core/CLucene/index/SDocumentWriter.cpp index fa0f992349c..4ff262f86d0 100644 --- a/src/core/CLucene/index/SDocumentWriter.cpp +++ b/src/core/CLucene/index/SDocumentWriter.cpp @@ -135,7 +135,9 @@ void SDocumentsWriter::ThreadState::resetCurrentFieldData(Document *doc) { numFieldData = 1; // reset fp for new fields fp->fieldCount = 0; + // delete values is not make length reset to 0, so resize can not make sure new docFields values fp->docFields.deleteValues(); + fp->docFields.length = 0; fp->docFields.resize(1); for (int32_t i = 0; i < numDocFields; i++) { Field *field = docFields[i];