diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-10-10 18:20:19 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-10-10 18:20:19 +0200 |
commit | 1719a202398ab3163da12b03801b1c0a4f5243b3 (patch) | |
tree | 7172a378964f8c82f27fb1b666b23da30ff30758 /searchlib | |
parent | 52cdc152dd61aee3e6c336fd787719ab2eb6d77b (diff) |
Pass empty vector to TokenExtractor::extract.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/memoryindex/field_inverter.cpp | 1 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/util/token_extractor.cpp | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/memoryindex/field_inverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/field_inverter.cpp index c469ba67765..2a54859352d 100644 --- a/searchlib/src/vespa/searchlib/memoryindex/field_inverter.cpp +++ b/searchlib/src/vespa/searchlib/memoryindex/field_inverter.cpp @@ -49,6 +49,7 @@ using vespalib::datastore::Aligner; void FieldInverter::processAnnotations(const StringFieldValue &value, const Document& doc) { + _terms.clear(); auto span_trees = value.getSpanTrees(); if (!TokenExtractor::extract(false, _terms, span_trees)) { /* This is wrong unless field is exact match */ diff --git a/searchlib/src/vespa/searchlib/util/token_extractor.cpp b/searchlib/src/vespa/searchlib/util/token_extractor.cpp index a5d9dc0a4a6..555ea86d299 100644 --- a/searchlib/src/vespa/searchlib/util/token_extractor.cpp +++ b/searchlib/src/vespa/searchlib/util/token_extractor.cpp @@ -67,7 +67,6 @@ TokenExtractor::extract(bool allow_zero_length_tokens, std::vector<SpanTerm>& te if (tree == nullptr) { return false; } - terms.clear(); for (const Annotation & annotation : *tree) { const SpanNode *span = annotation.getSpanNode(); if ((span != nullptr) && annotation.valid() && |