summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-05-27 11:50:30 +0200
committerTor Egge <Tor.Egge@online.no>2021-05-27 11:50:30 +0200
commitcf6fd468feaa4bdf5c0320c65a2c3a6eb496d767 (patch)
tree0828bd82dff17d890a52e6b9f44596ef6dc4a9ef /searchlib
parent6b6e59869ab5259a8cd2e382cd2b5164a963a293 (diff)
Load of tensor attribute with nearest neighbor index enabled but no
saved index will index documents during the load. Add occasional calls to commit() to prevent excessive growth of hold lists.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp
index be127a8be3e..d57b2c3db56 100644
--- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp
@@ -207,6 +207,9 @@ DenseTensorAttribute::onLoad()
// This ensures that get_vector() (via getTensor()) is able to find the newly added tensor.
setCommittedDocIdLimit(lid + 1);
_index->add_document(lid);
+ if ((lid & ((1u << 8) - 1)) == 0) {
+ commit();
+ }
}
} else {
_refVector.push_back(EntryRef());