aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-11-14 22:09:51 +0100
committerGitHub <noreply@github.com>2023-11-14 22:09:51 +0100
commiteba8370745e8531d41d9a2a94b6fa148e0895d84 (patch)
tree415aa3303379811bae61f254c972a42ea71e217a
parent43e875554b99d1d5a51cf3628aa2c3d731363514 (diff)
parent16d6f96c09716227e9b847c4c4e534e692401a02 (diff)
Merge pull request #29334 from vespa-engine/balder/more-eager-to-create-bitvectorv8.259.15
Only allow use of bitvector if it is a filter
-rw-r--r--searchlib/src/tests/attribute/bitvector/bitvector_test.cpp20
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postingstore.cpp4
2 files changed, 12 insertions, 12 deletions
diff --git a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp
index 63c0b784018..dfea4901180 100644
--- a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp
+++ b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp
@@ -43,9 +43,8 @@ struct BitVectorTest
{
using AttributePtr = AttributeVector::SP;
- BitVectorTest() { }
-
- ~BitVectorTest() { }
+ BitVectorTest();
+ ~BitVectorTest();
template <typename VectorType>
VectorType & as(AttributePtr &v);
@@ -102,6 +101,9 @@ struct BitVectorTest
test(BasicType bt, CollectionType ct, const vespalib::string &pref);
};
+BitVectorTest::BitVectorTest() = default;
+BitVectorTest::~BitVectorTest() = default;
+
template <typename VectorType>
VectorType &
@@ -427,16 +429,14 @@ BitVectorTest::test(BasicType bt, CollectionType ct, const vespalib::string &pre
SearchContextPtr sc = getSearch<VectorType>(tv, true);
checkSearch(v, std::move(sc), 2, 1022, 205, !fastSearch && !filter, true);
- sc = getSearch<VectorType>(tv, false);
+ sc = getSearch<VectorType>(tv, filter);
checkSearch(v, std::move(sc), 2, 1022, 205, !filter, true);
const search::IDocumentWeightAttribute *dwa = v->asDocumentWeightAttribute();
if (dwa != nullptr) {
- search::IDocumentWeightAttribute::LookupResult lres =
- dwa->lookup(getSearchStr<VectorType>(), dwa->get_dictionary_snapshot());
+ auto lres = dwa->lookup(getSearchStr<VectorType>(), dwa->get_dictionary_snapshot());
using DWSI = search::queryeval::DocumentWeightSearchIterator;
- using SI = search::queryeval::SearchIterator;
TermFieldMatchData md;
- SI::UP dwsi(new DWSI(md, *dwa, lres));
+ auto dwsi = std::make_unique<DWSI>(md, *dwa, lres);
if (!filter) {
TEST_DO(checkSearch(v, std::move(dwsi), md, 2, 1022, 205, !filter, true));
} else {
@@ -445,13 +445,13 @@ BitVectorTest::test(BasicType bt, CollectionType ct, const vespalib::string &pre
}
}
populate(tv, 2, 973, false);
- sc = getSearch<VectorType>(tv, true);
+ sc = getSearch<VectorType>(tv, filter);
checkSearch(v, std::move(sc), 977, 1022, 10, !filter, true);
populate(tv, 2, 973, true);
sc = getSearch<VectorType>(tv, true);
checkSearch(v, std::move(sc), 2, 1022, 205, !fastSearch && !filter, true);
addDocs(v, 15000);
- sc = getSearch<VectorType>(tv, true);
+ sc = getSearch<VectorType>(tv, filter);
checkSearch(v, std::move(sc), 2, 1022, 205, !filter, true);
populateAll(tv, 10, 15000, true);
sc = getSearch<VectorType>(tv, true);
diff --git a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp
index b9f4fd5ceca..2e9e5470b5f 100644
--- a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp
@@ -44,8 +44,8 @@ PostingStoreBase2::resizeBitVectors(uint32_t newSize, uint32_t newCapacity)
newSize = newCapacity;
if (newSize == _bvSize && newCapacity == _bvCapacity)
return false;
- _minBvDocFreq = std::max(newSize >> 6, 64u);
- _maxBvDocFreq = std::max(newSize >> 5, 128u);
+ _minBvDocFreq = std::max(newSize >> 7, 64u);
+ _maxBvDocFreq = std::max(newSize >> 6, 128u);
if (_bvs.empty()) {
_bvSize = newSize;
_bvCapacity = newCapacity;