summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-07-14 10:42:31 +0200
committerGitHub <noreply@github.com>2023-07-14 10:42:31 +0200
commit0a38c6b813cd118e7aab833699a2c8547d1c8e14 (patch)
treed8e5fd52c92cb974dded54b486bb951bbd67855b /searchlib
parentbf480e663efe4e7390285d624a7b383de66a1a10 (diff)
Revert "- Pack data closer to let config fit in 2 cache lines instead of 4."
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp2
-rw-r--r--searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp2
-rw-r--r--searchlib/src/vespa/searchcommon/attribute/basictype.h38
-rw-r--r--searchlib/src/vespa/searchcommon/attribute/collectiontype.h54
-rw-r--r--searchlib/src/vespa/searchcommon/attribute/config.cpp6
-rw-r--r--searchlib/src/vespa/searchcommon/attribute/config.h42
-rw-r--r--searchlib/src/vespa/searchcommon/attribute/distance_metric.h4
-rw-r--r--searchlib/src/vespa/searchcommon/attribute/persistent_predicate_params.h25
-rw-r--r--searchlib/src/vespa/searchcommon/attribute/predicate_params.h13
-rw-r--r--searchlib/src/vespa/searchcommon/common/dictionary_config.h9
-rw-r--r--searchlib/src/vespa/searchcommon/common/growstrategy.h8
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp46
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.h4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/string_search_helper.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/string_search_helper.h2
-rw-r--r--searchlib/src/vespa/searchlib/fef/properties.cpp22
-rw-r--r--searchlib/src/vespa/searchlib/fef/properties.h42
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/blueprint.cpp26
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/blueprint.h96
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/field_spec.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/field_spec.h34
22 files changed, 242 insertions, 243 deletions
diff --git a/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp b/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp
index 79ef6e42bb2..c5d70109015 100644
--- a/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp
+++ b/searchlib/src/tests/attribute/compaction/attribute_compaction_test.cpp
@@ -123,7 +123,7 @@ void hammerAttribute(AttributePtr &v, DocIdRange range, uint32_t count)
Config compactAddressSpaceAttributeConfig(bool enableAddressSpaceCompact)
{
Config cfg(BasicType::INT8, CollectionType::ARRAY);
- cfg.setCompactionStrategy({ 1.0f, (enableAddressSpaceCompact ? 0.2f : 1.0f) });
+ cfg.setCompactionStrategy({ 1.0, (enableAddressSpaceCompact ? 0.2 : 1.0) });
return cfg;
}
diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
index 5370eff78cf..0d64683b4a6 100644
--- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
+++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
@@ -1022,7 +1022,7 @@ TEST_F("require that lid space can be increased after being compacted and then s
TEST_F("require that there is control of static memory usage", Fixture)
{
vespalib::MemoryUsage usage = f.store.getMemoryUsage();
- EXPECT_EQUAL(520u + sizeof(LogDataStore::NameIdSet) + sizeof(std::mutex), sizeof(LogDataStore));
+ EXPECT_EQUAL(536u + sizeof(LogDataStore::NameIdSet) + sizeof(std::mutex), sizeof(LogDataStore));
EXPECT_EQUAL(74108u, usage.allocatedBytes());
EXPECT_EQUAL(384u, usage.usedBytes());
}
diff --git a/searchlib/src/vespa/searchcommon/attribute/basictype.h b/searchlib/src/vespa/searchcommon/attribute/basictype.h
index 407348fea92..46387dd2738 100644
--- a/searchlib/src/vespa/searchcommon/attribute/basictype.h
+++ b/searchlib/src/vespa/searchcommon/attribute/basictype.h
@@ -9,7 +9,7 @@ namespace search::attribute {
class BasicType
{
public:
- enum Type : uint8_t {
+ enum Type {
NONE = 0,
STRING = 1,
BOOL = 2,
@@ -28,33 +28,33 @@ class BasicType
MAX_TYPE
};
- explicit BasicType(int t) noexcept : _type(Type(t)) { }
- explicit BasicType(unsigned int t) noexcept : _type(Type(t)) { }
- BasicType(Type t) noexcept : _type(t) { }
+ explicit BasicType(int t) : _type(Type(t)) { }
+ explicit BasicType(unsigned int t) : _type(Type(t)) { }
+ BasicType(Type t) : _type(t) { }
explicit BasicType(const vespalib::string & t) : _type(asType(t)) { }
- Type type() const noexcept { return _type; }
- const char * asString() const noexcept { return asString(_type); }
- size_t fixedSize() const noexcept { return fixedSize(_type); }
- static BasicType fromType(bool) noexcept { return BOOL; }
- static BasicType fromType(int8_t) noexcept { return INT8; }
- static BasicType fromType(int16_t) noexcept { return INT16; }
- static BasicType fromType(int32_t) noexcept { return INT32; }
- static BasicType fromType(int64_t) noexcept { return INT64; }
- static BasicType fromType(float) noexcept { return FLOAT; }
- static BasicType fromType(double) noexcept { return DOUBLE; }
- bool operator==(const BasicType &b) const noexcept { return _type == b._type; }
- bool operator!=(const BasicType &b) const noexcept { return _type != b._type; }
+ Type type() const { return _type; }
+ const char * asString() const { return asString(_type); }
+ size_t fixedSize() const { return fixedSize(_type); }
+ static BasicType fromType(bool) { return BOOL; }
+ static BasicType fromType(int8_t) { return INT8; }
+ static BasicType fromType(int16_t) { return INT16; }
+ static BasicType fromType(int32_t) { return INT32; }
+ static BasicType fromType(int64_t) { return INT64; }
+ static BasicType fromType(float) { return FLOAT; }
+ static BasicType fromType(double) { return DOUBLE; }
+ bool operator==(const BasicType &b) const { return _type == b._type; }
+ bool operator!=(const BasicType &b) const { return _type != b._type; }
private:
- static const char * asString(Type t) noexcept { return _typeTable[t]._name; }
- static size_t fixedSize(Type t) noexcept { return _typeTable[t]._fixedSize; }
+ static const char * asString(Type t) { return _typeTable[t]._name; }
+ static size_t fixedSize(Type t) { return _typeTable[t]._fixedSize; }
static Type asType(const vespalib::string & t);
Type _type;
struct TypeInfo {
- Type _type;
+ Type _type;
unsigned int _fixedSize;
const char * _name;
};
diff --git a/searchlib/src/vespa/searchcommon/attribute/collectiontype.h b/searchlib/src/vespa/searchcommon/attribute/collectiontype.h
index 05fad8cbc64..35cb7612ed0 100644
--- a/searchlib/src/vespa/searchcommon/attribute/collectiontype.h
+++ b/searchlib/src/vespa/searchcommon/attribute/collectiontype.h
@@ -9,7 +9,7 @@ namespace search::attribute {
class CollectionType
{
public:
- enum Type : uint8_t {
+ enum Type {
/**
* Single value type with one value stored for each document.
**/
@@ -26,30 +26,32 @@ class CollectionType
MAX_TYPE
};
- CollectionType(Type t = SINGLE, bool remove = false, bool create = false) noexcept
- : _type(t),
- _removeIfZero(remove),
- _createIfNonExistant(create)
- { }
+ CollectionType(Type t = SINGLE, bool remove = false, bool create = false) :
+ _type(t),
+ _removeIfZero(remove),
+ _createIfNonExistant(create)
+ {
+ }
explicit
- CollectionType(const vespalib::string & t, bool remove = false, bool create = false)
- : _type(asType(t)),
- _removeIfZero(remove),
- _createIfNonExistant(create)
- { }
+ CollectionType(const vespalib::string & t, bool remove = false, bool create = false) :
+ _type(asType(t)),
+ _removeIfZero(remove),
+ _createIfNonExistant(create)
+ {
+ }
- Type type() const noexcept { return _type; }
- bool isMultiValue() const noexcept { return _type != SINGLE; }
- bool isWeightedSet() const noexcept { return _type == WSET; }
- bool isArray() const noexcept { return _type == ARRAY; }
- bool removeIfZero() const noexcept { return _removeIfZero; }
- bool createIfNonExistant() const noexcept { return _createIfNonExistant; }
- const char * asString() const noexcept { return asString(_type); }
- void removeIfZero(bool newValue) noexcept { _removeIfZero = newValue; }
- void createIfNonExistant(bool newValue) noexcept { _createIfNonExistant = newValue; }
- bool operator!=(const CollectionType &b) const noexcept { return !(operator==(b)); }
- bool operator==(const CollectionType &b) const noexcept {
+ Type type() const { return _type; }
+ bool isMultiValue() const { return _type != SINGLE; }
+ bool isWeightedSet() const { return _type == WSET; }
+ bool isArray() const { return _type == ARRAY; }
+ bool removeIfZero() const { return _removeIfZero; }
+ bool createIfNonExistant() const { return _createIfNonExistant; }
+ const char * asString() const { return asString(_type); }
+ void removeIfZero(bool newValue) { _removeIfZero = newValue; }
+ void createIfNonExistant(bool newValue) { _createIfNonExistant = newValue; }
+ bool operator!=(const CollectionType &b) const { return !(operator==(b)); }
+ bool operator==(const CollectionType &b) const {
return _type == b._type &&
_removeIfZero == b._removeIfZero &&
_createIfNonExistant == b._createIfNonExistant;
@@ -61,12 +63,12 @@ class CollectionType
const char * _name;
};
- static const char * asString(Type t) noexcept { return _typeTable[t]._name; }
+ static const char * asString(Type t) { return _typeTable[t]._name; }
static Type asType(const vespalib::string &t);
- Type _type : 4;
- bool _removeIfZero : 1;
- bool _createIfNonExistant : 1;
+ Type _type;
+ bool _removeIfZero;
+ bool _createIfNonExistant;
static const TypeInfo _typeTable[MAX_TYPE];
};
diff --git a/searchlib/src/vespa/searchcommon/attribute/config.cpp b/searchlib/src/vespa/searchcommon/attribute/config.cpp
index 7c302a10731..af29bd64ad6 100644
--- a/searchlib/src/vespa/searchcommon/attribute/config.cpp
+++ b/searchlib/src/vespa/searchcommon/attribute/config.cpp
@@ -23,14 +23,14 @@ Config::Config(BasicType bt, CollectionType ct, bool fastSearch_) noexcept
_fastAccess(false),
_mutable(false),
_paged(false),
- _distance_metric(DistanceMetric::Euclidean),
+ _maxUnCommittedMemory(MAX_UNCOMMITTED_MEMORY),
_match(Match::UNCASED),
_dictionary(),
- _maxUnCommittedMemory(MAX_UNCOMMITTED_MEMORY),
_growStrategy(),
_compactionStrategy(),
_predicateParams(),
_tensorType(vespalib::eval::ValueType::error_type()),
+ _distance_metric(DistanceMetric::Euclidean),
_hnsw_index_params()
{
}
@@ -42,7 +42,7 @@ Config & Config::operator = (Config &&) noexcept = default;
Config::~Config() = default;
bool
-Config::operator==(const Config &b) const noexcept
+Config::operator==(const Config &b) const
{
return _basicType == b._basicType &&
_type == b._type &&
diff --git a/searchlib/src/vespa/searchcommon/attribute/config.h b/searchlib/src/vespa/searchcommon/attribute/config.h
index 17c762267cc..b368885240c 100644
--- a/searchlib/src/vespa/searchcommon/attribute/config.h
+++ b/searchlib/src/vespa/searchcommon/attribute/config.h
@@ -21,7 +21,7 @@ namespace search::attribute {
*/
class Config {
public:
- enum class Match : uint8_t { CASED, UNCASED };
+ enum class Match { CASED, UNCASED };
using CompactionStrategy = vespalib::datastore::CompactionStrategy;
Config() noexcept;
Config(BasicType bt) noexcept : Config(bt, CollectionType::SINGLE) { }
@@ -33,27 +33,27 @@ public:
Config & operator = (Config &&) noexcept;
~Config();
- BasicType basicType() const noexcept { return _basicType; }
- CollectionType collectionType() const noexcept { return _type; }
- bool fastSearch() const noexcept { return _fastSearch; }
- bool paged() const noexcept { return _paged; }
- const PredicateParams &predicateParams() const noexcept { return _predicateParams; }
- const vespalib::eval::ValueType & tensorType() const noexcept { return _tensorType; }
- DistanceMetric distance_metric() const noexcept { return _distance_metric; }
+ BasicType basicType() const { return _basicType; }
+ CollectionType collectionType() const { return _type; }
+ bool fastSearch() const { return _fastSearch; }
+ bool paged() const { return _paged; }
+ const PredicateParams &predicateParams() const { return _predicateParams; }
+ const vespalib::eval::ValueType & tensorType() const { return _tensorType; }
+ DistanceMetric distance_metric() const { return _distance_metric; }
const std::optional<HnswIndexParams>& hnsw_index_params() const { return _hnsw_index_params; }
/**
* Check if attribute posting list can consist of only a bitvector with
* no corresponding btree.
*/
- bool getIsFilter() const noexcept { return _isFilter; }
- bool isMutable() const noexcept { return _mutable; }
+ bool getIsFilter() const { return _isFilter; }
+ bool isMutable() const { return _mutable; }
/**
* Check if this attribute should be fast accessible at all times.
* If so, attribute is kept in memory also for non-searchable documents.
*/
- bool fastAccess() const noexcept { return _fastAccess; }
+ bool fastAccess() const { return _fastAccess; }
const GrowStrategy & getGrowStrategy() const { return _growStrategy; }
const CompactionStrategy &getCompactionStrategy() const { return _compactionStrategy; }
@@ -92,28 +92,28 @@ public:
}
Config & set_dictionary_config(const DictionaryConfig & cfg) { _dictionary = cfg; return *this; }
Config & set_match(Match match) { _match = match; return *this; }
- bool operator!=(const Config &b) const noexcept { return !(operator==(b)); }
- bool operator==(const Config &b) const noexcept ;
+ bool operator!=(const Config &b) const { return !(operator==(b)); }
+ bool operator==(const Config &b) const;
- uint64_t getMaxUnCommittedMemory() const noexcept { return _maxUnCommittedMemory; }
+ uint64_t getMaxUnCommittedMemory() const { return _maxUnCommittedMemory; }
Config & setMaxUnCommittedMemory(uint64_t value) { _maxUnCommittedMemory = value; return *this; }
private:
BasicType _basicType;
CollectionType _type;
- bool _fastSearch : 1;
- bool _isFilter : 1;
- bool _fastAccess : 1;
- bool _mutable : 1;
- bool _paged : 1;
- DistanceMetric _distance_metric;
+ bool _fastSearch;
+ bool _isFilter;
+ bool _fastAccess;
+ bool _mutable;
+ bool _paged;
+ uint64_t _maxUnCommittedMemory;
Match _match;
DictionaryConfig _dictionary;
- uint64_t _maxUnCommittedMemory;
GrowStrategy _growStrategy;
CompactionStrategy _compactionStrategy;
PredicateParams _predicateParams;
vespalib::eval::ValueType _tensorType;
+ DistanceMetric _distance_metric;
std::optional<HnswIndexParams> _hnsw_index_params;
};
diff --git a/searchlib/src/vespa/searchcommon/attribute/distance_metric.h b/searchlib/src/vespa/searchcommon/attribute/distance_metric.h
index 35f5fb4fe6b..9f9f45810b9 100644
--- a/searchlib/src/vespa/searchcommon/attribute/distance_metric.h
+++ b/searchlib/src/vespa/searchcommon/attribute/distance_metric.h
@@ -2,10 +2,8 @@
#pragma once
-#include <cstdint>
-
namespace search::attribute {
-enum DistanceMetric : uint8_t { Euclidean, Angular, GeoDegrees, InnerProduct, Hamming, PrenormalizedAngular, Dotproduct };
+enum class DistanceMetric { Euclidean, Angular, GeoDegrees, InnerProduct, Hamming, PrenormalizedAngular, Dotproduct };
}
diff --git a/searchlib/src/vespa/searchcommon/attribute/persistent_predicate_params.h b/searchlib/src/vespa/searchcommon/attribute/persistent_predicate_params.h
index 205a75c188f..d81eb9c5d3c 100644
--- a/searchlib/src/vespa/searchcommon/attribute/persistent_predicate_params.h
+++ b/searchlib/src/vespa/searchcommon/attribute/persistent_predicate_params.h
@@ -10,23 +10,24 @@ namespace search::attribute {
* Persistent parameters for predicate attributes.
*/
class PersistentPredicateParams {
+ uint32_t _arity;
int64_t _lower_bound;
int64_t _upper_bound;
- uint32_t _arity;
public:
- PersistentPredicateParams() noexcept
- : _lower_bound(std::numeric_limits<int64_t>::min()),
- _upper_bound(std::numeric_limits<int64_t>::max()),
- _arity(8)
- { }
- uint32_t arity() const noexcept { return _arity; }
- int64_t lower_bound() const noexcept { return _lower_bound; }
- int64_t upper_bound() const noexcept { return _upper_bound; }
- void setArity(uint32_t v) noexcept { _arity = v; }
- void setBounds(int64_t lower, int64_t upper) noexcept { _lower_bound = lower; _upper_bound = upper; }
+ PersistentPredicateParams()
+ : _arity(8),
+ _lower_bound(std::numeric_limits<int64_t>::min()),
+ _upper_bound(std::numeric_limits<int64_t>::max())
+ {
+ }
+ uint32_t arity() const { return _arity; }
+ int64_t lower_bound() const { return _lower_bound; }
+ int64_t upper_bound() const { return _upper_bound; }
+ void setArity(uint32_t v) { _arity = v; }
+ void setBounds(int64_t lower, int64_t upper) { _lower_bound = lower; _upper_bound = upper; }
- bool operator==(const PersistentPredicateParams &rhs) const noexcept {
+ bool operator==(const PersistentPredicateParams &rhs) const {
return ((_arity == rhs._arity) &&
(_lower_bound == rhs._lower_bound) &&
(_upper_bound == rhs._upper_bound));
diff --git a/searchlib/src/vespa/searchcommon/attribute/predicate_params.h b/searchlib/src/vespa/searchcommon/attribute/predicate_params.h
index 7e9258ab5db..133b7331689 100644
--- a/searchlib/src/vespa/searchcommon/attribute/predicate_params.h
+++ b/searchlib/src/vespa/searchcommon/attribute/predicate_params.h
@@ -11,16 +11,17 @@ namespace search::attribute {
*/
class PredicateParams : public PersistentPredicateParams
{
- float _dense_posting_list_threshold;
+ double _dense_posting_list_threshold;
public:
- PredicateParams() noexcept
+ PredicateParams()
: PersistentPredicateParams(),
_dense_posting_list_threshold(0.4)
- { }
+ {
+ }
- float dense_posting_list_threshold() const noexcept { return _dense_posting_list_threshold; }
- void setDensePostingListThreshold(float v) noexcept { _dense_posting_list_threshold = v; }
- bool operator==(const PredicateParams &rhs) const noexcept {
+ double dense_posting_list_threshold() const { return _dense_posting_list_threshold; }
+ void setDensePostingListThreshold(double v) { _dense_posting_list_threshold = v; }
+ bool operator==(const PredicateParams &rhs) const {
return (PersistentPredicateParams::operator==(rhs) &&
(_dense_posting_list_threshold == rhs._dense_posting_list_threshold));
}
diff --git a/searchlib/src/vespa/searchcommon/common/dictionary_config.h b/searchlib/src/vespa/searchcommon/common/dictionary_config.h
index f504439c5a3..f51341ad799 100644
--- a/searchlib/src/vespa/searchcommon/common/dictionary_config.h
+++ b/searchlib/src/vespa/searchcommon/common/dictionary_config.h
@@ -3,7 +3,6 @@
#pragma once
#include <iosfwd>
-#include <cstdint>
namespace search {
@@ -12,8 +11,8 @@ namespace search {
*/
class DictionaryConfig {
public:
- enum class Type : uint8_t { BTREE, HASH, BTREE_AND_HASH };
- enum class Match : uint8_t { CASED, UNCASED };
+ enum class Type { BTREE, HASH, BTREE_AND_HASH };
+ enum class Match { CASED, UNCASED };
DictionaryConfig() noexcept : _type(Type::BTREE), _match(Match::UNCASED) {}
DictionaryConfig(Type type) noexcept : _type(type), _match(Match::UNCASED) {}
DictionaryConfig(Type type, Match match) noexcept : _type(type), _match(match) {}
@@ -21,8 +20,8 @@ public:
Match getMatch() const { return _match; }
bool operator == (const DictionaryConfig & b) const { return (_type == b._type) && (_match == b._match); }
private:
- Type _type : 4;
- Match _match : 4;
+ Type _type;
+ Match _match;
};
std::ostream& operator<<(std::ostream& os, const DictionaryConfig & cfg);
diff --git a/searchlib/src/vespa/searchcommon/common/growstrategy.h b/searchlib/src/vespa/searchcommon/common/growstrategy.h
index 86750eafbfc..8766989ded0 100644
--- a/searchlib/src/vespa/searchcommon/common/growstrategy.h
+++ b/searchlib/src/vespa/searchcommon/common/growstrategy.h
@@ -23,17 +23,17 @@ public:
{
}
- static GrowStrategy make(uint32_t docsInitialCapacity, float docsGrowFactor, uint32_t docsGrowDelta) noexcept {
+ static GrowStrategy make(uint32_t docsInitialCapacity, float docsGrowFactor, uint32_t docsGrowDelta) {
return {docsInitialCapacity, docsGrowFactor, docsGrowDelta, 0, 0.2};
}
- float getMultiValueAllocGrowFactor() const noexcept { return _multiValueAllocGrowFactor; }
+ float getMultiValueAllocGrowFactor() const { return _multiValueAllocGrowFactor; }
- bool operator==(const GrowStrategy & rhs) const noexcept {
+ bool operator==(const GrowStrategy & rhs) const {
return vespalib::GrowStrategy::operator==(rhs) &&
(_multiValueAllocGrowFactor == rhs._multiValueAllocGrowFactor);
}
- bool operator!=(const GrowStrategy & rhs) const noexcept {
+ bool operator!=(const GrowStrategy & rhs) const {
return !(operator==(rhs));
}
};
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
index 152fcef5e8b..1c6455dec84 100644
--- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp
@@ -129,10 +129,26 @@ private:
public:
AttributeFieldBlueprint(const FieldSpec &field, const IAttributeVector &attribute,
- const string &query_stack, const SearchContextParams &params);
+ const string &query_stack, const SearchContextParams &params)
+ : AttributeFieldBlueprint(field, attribute, QueryTermDecoder::decodeTerm(query_stack), params)
+ { }
AttributeFieldBlueprint(const FieldSpec &field, const IAttributeVector &attribute,
- QueryTermSimple::UP term, const SearchContextParams &params);
- ~AttributeFieldBlueprint() override;
+ QueryTermSimple::UP term, const SearchContextParams &params)
+ : SimpleLeafBlueprint(field),
+ _attr(attribute),
+ _query_term(term->getTermString()),
+ _search_context(attribute.createSearchContext(std::move(term), params)),
+ _type(OTHER)
+ {
+ uint32_t estHits = _search_context->approximateHits();
+ HitEstimate estimate(estHits, estHits == 0);
+ setEstimate(estimate);
+ if (attribute.isFloatingPointType()) {
+ _type = FLOAT;
+ } else if (attribute.isIntegerType()) {
+ _type = INT;
+ }
+ }
SearchIteratorUP createLeafSearch(const TermFieldMatchDataArray &tfmda, bool strict) const override {
assert(tfmda.size() == 1);
@@ -164,30 +180,6 @@ public:
bool getRange(vespalib::string &from, vespalib::string &to) const override;
};
-AttributeFieldBlueprint::~AttributeFieldBlueprint() = default;
-
-AttributeFieldBlueprint::AttributeFieldBlueprint(const FieldSpec &field, const IAttributeVector &attribute,
- const string &query_stack, const SearchContextParams &params)
- : AttributeFieldBlueprint(field, attribute, QueryTermDecoder::decodeTerm(query_stack), params)
-{ }
-AttributeFieldBlueprint::AttributeFieldBlueprint(const FieldSpec &field, const IAttributeVector &attribute,
- QueryTermSimple::UP term, const SearchContextParams &params)
- : SimpleLeafBlueprint(field),
- _attr(attribute),
- _query_term(term->getTermString()),
- _search_context(attribute.createSearchContext(std::move(term), params)),
- _type(OTHER)
-{
- uint32_t estHits = _search_context->approximateHits();
- HitEstimate estimate(estHits, estHits == 0);
- setEstimate(estimate);
- if (attribute.isFloatingPointType()) {
- _type = FLOAT;
- } else if (attribute.isIntegerType()) {
- _type = INT;
- }
-}
-
vespalib::string
get_type(const IAttributeVector& attr)
{
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
index d606daaa3e0..b053b386593 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
@@ -125,8 +125,6 @@ bool AttributeVector::hasArrayType() const { return _config->collectionType().is
bool AttributeVector::getIsFilter() const { return _config->getIsFilter(); }
bool AttributeVector::getIsFastSearch() const { return _config->fastSearch(); }
bool AttributeVector::isMutable() const { return _config->isMutable(); }
-attribute::BasicType::Type AttributeVector::getBasicType() const { return _config->basicType().type(); }
-attribute::CollectionType::Type AttributeVector::getCollectionType() const { return _config->collectionType().type(); }
bool
AttributeVector::isEnumerated(const vespalib::GenericHeader &header)
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h
index 68dfe52643f..5fd6cb915fa 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.h
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h
@@ -319,8 +319,8 @@ public:
AddressSpaceUsage getAddressSpaceUsage() const;
- BasicType::Type getBasicType() const override final;
- CollectionType::Type getCollectionType() const override final;
+ BasicType::Type getBasicType() const override final { return getInternalBasicType().type(); }
+ CollectionType::Type getCollectionType() const override final { return getInternalCollectionType().type(); }
uint32_t getCommittedDocIdLimit() const override final { return _committedDocIdLimit.load(std::memory_order_acquire); }
bool isImported() const override;
diff --git a/searchlib/src/vespa/searchlib/attribute/string_search_helper.cpp b/searchlib/src/vespa/searchlib/attribute/string_search_helper.cpp
index 6e56f5477c2..17a0e6256d4 100644
--- a/searchlib/src/vespa/searchlib/attribute/string_search_helper.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/string_search_helper.cpp
@@ -41,7 +41,7 @@ StringSearchHelper::StringSearchHelper(StringSearchHelper&&) noexcept = default;
StringSearchHelper::~StringSearchHelper() = default;
bool
-StringSearchHelper::isMatch(const char *src) const noexcept {
+StringSearchHelper::isMatch(const char *src) const {
if (__builtin_expect(isRegex(), false)) {
return getRegex().valid() && getRegex().partial_match(std::string_view(src));
}
diff --git a/searchlib/src/vespa/searchlib/attribute/string_search_helper.h b/searchlib/src/vespa/searchlib/attribute/string_search_helper.h
index 0c52692ee04..7bfcf0e4292 100644
--- a/searchlib/src/vespa/searchlib/attribute/string_search_helper.h
+++ b/searchlib/src/vespa/searchlib/attribute/string_search_helper.h
@@ -22,7 +22,7 @@ public:
StringSearchHelper(const StringSearchHelper &) = delete;
StringSearchHelper & operator =(const StringSearchHelper &) = delete;
~StringSearchHelper();
- bool isMatch(const char *src) const noexcept;
+ bool isMatch(const char *src) const;
bool isPrefix() const noexcept { return _isPrefix; }
bool isRegex() const noexcept { return _isRegex; }
bool isCased() const noexcept { return _isCased; }
diff --git a/searchlib/src/vespa/searchlib/fef/properties.cpp b/searchlib/src/vespa/searchlib/fef/properties.cpp
index 2cc4e50b593..6f334630dc5 100644
--- a/searchlib/src/vespa/searchlib/fef/properties.cpp
+++ b/searchlib/src/vespa/searchlib/fef/properties.cpp
@@ -11,7 +11,7 @@ const Property::Value Property::_emptyValue;
const Property::Values Property::_emptyValues;
const Property::Value &
-Property::getAt(uint32_t idx) const noexcept
+Property::getAt(uint32_t idx) const
{
if (idx < (*_values).size()) {
return (*_values)[idx];
@@ -22,7 +22,7 @@ Property::getAt(uint32_t idx) const noexcept
//-----------------------------------------------------------------------------
uint32_t
-Properties::rawHash(const void *buf, uint32_t len) noexcept
+Properties::rawHash(const void *buf, uint32_t len)
{
uint32_t res = 0;
unsigned const char *pt = (unsigned const char *) buf;
@@ -33,7 +33,7 @@ Properties::rawHash(const void *buf, uint32_t len) noexcept
return res;
}
-Properties::Properties() noexcept
+Properties::Properties()
: _numValues(0),
_data()
{
@@ -59,7 +59,7 @@ Properties::add(vespalib::stringref key, vespalib::stringref value)
}
uint32_t
-Properties::count(vespalib::stringref key) const noexcept
+Properties::count(vespalib::stringref key) const
{
if (!key.empty()) {
auto node = _data.find(key);
@@ -112,14 +112,14 @@ Properties::clear()
}
bool
-Properties::operator==(const Properties &rhs) const noexcept
+Properties::operator==(const Properties &rhs) const
{
return (_numValues == rhs._numValues &&
_data == rhs._data);
}
uint32_t
-Properties::hashCode() const noexcept
+Properties::hashCode() const
{
uint32_t hash = numKeys() + numValues();
for (const auto& elem : _data) {
@@ -159,7 +159,7 @@ Properties::visitNamespace(vespalib::stringref ns,
}
Property
-Properties::lookup(vespalib::stringref key) const noexcept
+Properties::lookup(vespalib::stringref key) const
{
if (key.empty()) {
return Property();
@@ -172,7 +172,7 @@ Properties::lookup(vespalib::stringref key) const noexcept
}
Property Properties::lookup(vespalib::stringref namespace1,
- vespalib::stringref key) const noexcept
+ vespalib::stringref key) const
{
if (namespace1.empty() || key.empty()) {
return Property();
@@ -184,7 +184,7 @@ Property Properties::lookup(vespalib::stringref namespace1,
Property Properties::lookup(vespalib::stringref namespace1,
vespalib::stringref namespace2,
- vespalib::stringref key) const noexcept
+ vespalib::stringref key) const
{
if (namespace1.empty() || namespace2.empty() || key.empty()) {
return Property();
@@ -197,7 +197,7 @@ Property Properties::lookup(vespalib::stringref namespace1,
Property Properties::lookup(vespalib::stringref namespace1,
vespalib::stringref namespace2,
vespalib::stringref namespace3,
- vespalib::stringref key) const noexcept
+ vespalib::stringref key) const
{
if (namespace1.empty() || namespace2.empty() || namespace3.empty() || key.empty()) {
return Property();
@@ -207,7 +207,7 @@ Property Properties::lookup(vespalib::stringref namespace1,
return lookup(fullKey);
}
-void Properties::swap(Properties & rhs) noexcept
+void Properties::swap(Properties & rhs)
{
_data.swap(rhs._data);
std::swap(_numValues, rhs._numValues);
diff --git a/searchlib/src/vespa/searchlib/fef/properties.h b/searchlib/src/vespa/searchlib/fef/properties.h
index 80e8c70939c..a6ae83b0339 100644
--- a/searchlib/src/vespa/searchlib/fef/properties.h
+++ b/searchlib/src/vespa/searchlib/fef/properties.h
@@ -37,7 +37,7 @@ private:
*
* @param values the values for this property
**/
- Property(const Values &values) noexcept : _values(&values) { }
+ Property(const Values &values) : _values(&values) { }
public:
/**
@@ -46,14 +46,14 @@ public:
* object on the stack in the application, and will also be used
* by the @ref Properties class when a lookup gives no results.
**/
- Property() noexcept : _values(&_emptyValues) { }
+ Property() : _values(&_emptyValues) { }
/**
* Check if we found what we were looking for or not.
*
* @return true if the key we looked up had at least one value
**/
- bool found() const noexcept {
+ bool found() const {
return !(*_values).empty();
}
@@ -63,7 +63,7 @@ public:
*
* @return first value for the looked up key, or ""
**/
- const Value &get() const noexcept {
+ const Value &get() const {
if ((*_values).empty()) {
return _emptyValue;
}
@@ -78,7 +78,7 @@ public:
* @return first value for the looked up key, or fallBack
* @param fallBack value to return if no values were found
**/
- const Value & get(const Value &fallBack) const noexcept {
+ const Value & get(const Value &fallBack) const {
if ((*_values).empty()) {
return fallBack;
}
@@ -90,7 +90,7 @@ public:
*
* @return number of values for this property
**/
- uint32_t size() const noexcept { return (*_values).size(); }
+ uint32_t size() const { return (*_values).size(); }
/**
* Obtain a specific value for the looked up key.
@@ -98,7 +98,7 @@ public:
* @return the requested value, or "" if idx was out of bounds
* @param idx the index of the value we want to access
**/
- const Value &getAt(uint32_t idx) const noexcept;
+ const Value &getAt(uint32_t idx) const;
};
//-----------------------------------------------------------------------------
@@ -127,7 +127,7 @@ public:
/**
* Virtual destructor to allow safe subclassing.
**/
- virtual ~IPropertiesVisitor() = default;
+ virtual ~IPropertiesVisitor() {}
};
//-----------------------------------------------------------------------------
@@ -156,7 +156,7 @@ private:
* @param buf data pointer
* @param len data length
**/
- static uint32_t rawHash(const void *buf, uint32_t len) noexcept;
+ static uint32_t rawHash(const void *buf, uint32_t len);
public:
using UP = std::unique_ptr<Properties>;
@@ -164,7 +164,7 @@ public:
/**
* Create an empty properties object.
**/
- Properties() noexcept;
+ Properties();
Properties(Properties &&) noexcept = default;
Properties & operator=(Properties &&) noexcept = default;
Properties(const Properties &);
@@ -192,7 +192,7 @@ public:
* @return number of values for the given key
* @param key the key
**/
- uint32_t count(vespalib::stringref key) const noexcept;
+ uint32_t count(vespalib::stringref key) const;
/**
* Remove all values for the given key.
@@ -226,14 +226,14 @@ public:
*
* @return number of keys
**/
- uint32_t numKeys() const noexcept { return _data.size(); }
+ uint32_t numKeys() const { return _data.size(); }
/**
* Obtain the total number of values stored in this object.
*
* @return number of values
**/
- uint32_t numValues() const noexcept { return _numValues; }
+ uint32_t numValues() const { return _numValues; }
/**
* Check if rhs contains the same key/value pairs as this
@@ -242,14 +242,14 @@ public:
*
* @return true if we are equal to rhs
**/
- bool operator==(const Properties &rhs) const noexcept;
+ bool operator==(const Properties &rhs) const;
/**
* Calculate a hash code for this object
*
* @return hash code for this object
**/
- uint32_t hashCode() const noexcept;
+ uint32_t hashCode() const;
/**
* Visit all key/value pairs
@@ -275,7 +275,7 @@ public:
* @return object encapsulating lookup result
* @param key the key to look up
**/
- Property lookup(vespalib::stringref key) const noexcept;
+ Property lookup(vespalib::stringref key) const;
/**
* Look up a key inside a namespace using the proposed namespace
@@ -289,7 +289,7 @@ public:
* @param key the key to look up
**/
Property lookup(vespalib::stringref namespace1,
- vespalib::stringref key) const noexcept;
+ vespalib::stringref key) const;
/**
* Look up a key inside a namespace using the proposed namespace
@@ -305,7 +305,7 @@ public:
**/
Property lookup(vespalib::stringref namespace1,
vespalib::stringref namespace2,
- vespalib::stringref key) const noexcept;
+ vespalib::stringref key) const;
/**
* Look up a key inside a namespace using the proposed namespace
@@ -323,13 +323,13 @@ public:
Property lookup(vespalib::stringref namespace1,
vespalib::stringref namespace2,
vespalib::stringref namespace3,
- vespalib::stringref key) const noexcept;
+ vespalib::stringref key) const;
- void swap(Properties & rhs) noexcept ;
+ void swap(Properties & rhs);
};
inline void
-swap(Properties & a, Properties & b) noexcept
+swap(Properties & a, Properties & b)
{
a.swap(b);
}
diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
index 3f6085ef7ff..488c58e3119 100644
--- a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
@@ -87,7 +87,7 @@ Blueprint::sat_sum(const std::vector<HitEstimate> &data, uint32_t docid_limit)
return { uint32_t(std::min(sum, uint64_t(limit))), empty };
}
-Blueprint::State::State() noexcept
+Blueprint::State::State()
: _fields(),
_estimateHits(0),
_tree_size(1),
@@ -97,13 +97,13 @@ Blueprint::State::State() noexcept
_cost_tier(COST_TIER_NORMAL)
{}
-Blueprint::State::State(FieldSpecBase field) noexcept
+Blueprint::State::State(FieldSpecBase field)
: State()
{
_fields.add(field);
}
-Blueprint::State::State(FieldSpecBaseList fields_in) noexcept
+Blueprint::State::State(FieldSpecBaseList fields_in)
: _fields(std::move(fields_in)),
_estimateHits(0),
_tree_size(1),
@@ -116,7 +116,7 @@ Blueprint::State::State(FieldSpecBaseList fields_in) noexcept
Blueprint::State::~State() = default;
-Blueprint::Blueprint() noexcept
+Blueprint::Blueprint()
: _parent(0),
_sourceId(0xffffffff),
_docid_limit(0),
@@ -383,7 +383,7 @@ StateCache::notifyChange() {
IntermediateBlueprint::~IntermediateBlueprint() = default;
void
-IntermediateBlueprint::setDocIdLimit(uint32_t limit) noexcept
+IntermediateBlueprint::setDocIdLimit(uint32_t limit)
{
Blueprint::setDocIdLimit(limit);
for (Blueprint::UP &child : _children) {
@@ -576,7 +576,7 @@ IntermediateBlueprint::createSearch(fef::MatchData &md, bool strict) const
return createIntermediateSearch(std::move(subSearches), strict, md);
}
-IntermediateBlueprint::IntermediateBlueprint() noexcept = default;
+IntermediateBlueprint::IntermediateBlueprint() = default;
IntermediateBlueprint &
IntermediateBlueprint::addChild(Blueprint::UP child)
@@ -737,6 +737,13 @@ LeafBlueprint::optimize(Blueprint* &self)
}
void
+LeafBlueprint::setEstimate(HitEstimate est)
+{
+ _state.estimate(est);
+ notifyChange();
+}
+
+void
LeafBlueprint::set_cost_tier(uint32_t value)
{
assert(value < 0x100);
@@ -745,6 +752,13 @@ LeafBlueprint::set_cost_tier(uint32_t value)
}
void
+LeafBlueprint::set_allow_termwise_eval(bool value)
+{
+ _state.allow_termwise_eval(value);
+ notifyChange();
+}
+
+void
LeafBlueprint::set_want_global_filter(bool value)
{
_state.want_global_filter(value);
diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.h b/searchlib/src/vespa/searchlib/queryeval/blueprint.h
index 8d230b6ec01..dc7a0992d82 100644
--- a/searchlib/src/vespa/searchlib/queryeval/blueprint.h
+++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.h
@@ -48,11 +48,11 @@ public:
uint32_t estHits;
bool empty;
- HitEstimate() noexcept : estHits(0), empty(true) {}
- HitEstimate(uint32_t estHits_, bool empty_) noexcept
+ HitEstimate() : estHits(0), empty(true) {}
+ HitEstimate(uint32_t estHits_, bool empty_)
: estHits(estHits_), empty(empty_) {}
- bool operator < (const HitEstimate &other) const noexcept {
+ bool operator < (const HitEstimate &other) const {
if (empty == other.empty) {
return (estHits < other.estHits);
} else {
@@ -77,21 +77,21 @@ public:
static constexpr uint8_t COST_TIER_EXPENSIVE = 2;
static constexpr uint8_t COST_TIER_MAX = 255;
- State() noexcept;
- State(FieldSpecBase field) noexcept;
- State(FieldSpecBaseList fields_in) noexcept;
+ State();
+ State(FieldSpecBase field);
+ State(FieldSpecBaseList fields_in);
State(const State &rhs) = delete;
State(State &&rhs) noexcept = default;
State &operator=(const State &rhs) = delete;
State &operator=(State &&rhs) noexcept = default;
~State();
- bool isTermLike() const noexcept { return !_fields.empty(); }
- const FieldSpecBaseList &fields() const noexcept { return _fields; }
+ bool isTermLike() const { return !_fields.empty(); }
+ const FieldSpecBaseList &fields() const { return _fields; }
- size_t numFields() const noexcept { return _fields.size(); }
- const FieldSpecBase &field(size_t idx) const noexcept { return _fields[idx]; }
- const FieldSpecBase *lookupField(uint32_t fieldId) const noexcept {
+ size_t numFields() const { return _fields.size(); }
+ const FieldSpecBase &field(size_t idx) const { return _fields[idx]; }
+ const FieldSpecBase *lookupField(uint32_t fieldId) const {
for (const FieldSpecBase & field : _fields) {
if (field.getFieldId() == fieldId) {
return &field;
@@ -100,27 +100,27 @@ public:
return nullptr;
}
- void estimate(HitEstimate est) noexcept {
+ void estimate(HitEstimate est) {
_estimateHits = est.estHits;
_estimateEmpty = est.empty;
}
- HitEstimate estimate() const noexcept { return HitEstimate(_estimateHits, _estimateEmpty); }
- double hit_ratio(uint32_t docid_limit) const noexcept {
+ HitEstimate estimate() const { return HitEstimate(_estimateHits, _estimateEmpty); }
+ double hit_ratio(uint32_t docid_limit) const {
uint32_t total_hits = _estimateHits;
uint32_t total_docs = std::max(total_hits, docid_limit);
return (total_docs == 0) ? 0.0 : double(total_hits) / double(total_docs);
}
- void tree_size(uint32_t value) noexcept {
+ void tree_size(uint32_t value) {
assert(value < 0x100000);
_tree_size = value;
}
- uint32_t tree_size() const noexcept { return _tree_size; }
- void allow_termwise_eval(bool value) noexcept { _allow_termwise_eval = value; }
- bool allow_termwise_eval() const noexcept { return _allow_termwise_eval; }
- void want_global_filter(bool value) noexcept { _want_global_filter = value; }
- bool want_global_filter() const noexcept { return _want_global_filter; }
- void cost_tier(uint8_t value) noexcept { _cost_tier = value; }
- uint8_t cost_tier() const noexcept { return _cost_tier; }
+ uint32_t tree_size() const { return _tree_size; }
+ void allow_termwise_eval(bool value) { _allow_termwise_eval = value; }
+ bool allow_termwise_eval() const { return _allow_termwise_eval; }
+ void want_global_filter(bool value) { _want_global_filter = value; }
+ bool want_global_filter() const { return _want_global_filter; }
+ void cost_tier(uint8_t value) { _cost_tier = value; }
+ uint8_t cost_tier() const { return _cost_tier; }
};
// utility that just takes maximum estimate
@@ -137,7 +137,7 @@ public:
// utility to get the greater estimate to sort first, higher tiers last
struct TieredGreaterEstimate {
- bool operator () (const auto &a, const auto &b) const noexcept {
+ bool operator () (const auto &a, const auto &b) const {
const auto &lhs = a->getState();
const auto &rhs = b->getState();
if (lhs.cost_tier() != rhs.cost_tier()) {
@@ -149,7 +149,7 @@ public:
// utility to get the lesser estimate to sort first, higher tiers last
struct TieredLessEstimate {
- bool operator () (const auto &a, const auto &b) const noexcept {
+ bool operator () (const auto &a, const auto &b) const {
const auto &lhs = a->getState();
const auto &rhs = b->getState();
if (lhs.cost_tier() != rhs.cost_tier()) {
@@ -189,20 +189,20 @@ public:
// hit that isn't certain to be a match).
enum class FilterConstraint { UPPER_BOUND, LOWER_BOUND };
- Blueprint() noexcept;
+ Blueprint();
Blueprint(const Blueprint &) = delete;
Blueprint &operator=(const Blueprint &) = delete;
virtual ~Blueprint();
- void setParent(Blueprint *parent) noexcept { _parent = parent; }
- Blueprint *getParent() const noexcept { return _parent; }
+ void setParent(Blueprint *parent) { _parent = parent; }
+ Blueprint *getParent() const { return _parent; }
bool has_parent() const { return (_parent != nullptr); }
- Blueprint &setSourceId(uint32_t sourceId) noexcept { _sourceId = sourceId; return *this; }
- uint32_t getSourceId() const noexcept { return _sourceId; }
+ Blueprint &setSourceId(uint32_t sourceId) { _sourceId = sourceId; return *this; }
+ uint32_t getSourceId() const { return _sourceId; }
- virtual void setDocIdLimit(uint32_t limit) noexcept { _docid_limit = limit; }
- uint32_t get_docid_limit() const noexcept { return _docid_limit; }
+ virtual void setDocIdLimit(uint32_t limit) { _docid_limit = limit; }
+ uint32_t get_docid_limit() const { return _docid_limit; }
static Blueprint::UP optimize(Blueprint::UP bp);
virtual void optimize(Blueprint* &self) = 0;
@@ -227,7 +227,7 @@ public:
virtual const State &getState() const = 0;
const Blueprint &root() const;
- double hit_ratio() const noexcept { return getState().hit_ratio(_docid_limit); }
+ double hit_ratio() const { return getState().hit_ratio(_docid_limit); }
virtual void fetchPostings(const ExecuteInfo &execInfo) = 0;
virtual void freeze() = 0;
@@ -319,10 +319,10 @@ protected:
public:
using IndexList = std::vector<size_t>;
- IntermediateBlueprint() noexcept;
+ IntermediateBlueprint();
~IntermediateBlueprint() override;
- void setDocIdLimit(uint32_t limit) noexcept final;
+ void setDocIdLimit(uint32_t limit) final;
void optimize(Blueprint* &self) final;
void set_global_filter(const GlobalFilter &global_filter, double estimated_hit_ratio) override;
@@ -360,30 +360,24 @@ private:
State _state;
protected:
void optimize(Blueprint* &self) final;
- void setEstimate(HitEstimate est) {
- _state.estimate(est);
- notifyChange();
- }
+ void setEstimate(HitEstimate est);
void set_cost_tier(uint32_t value);
- void set_allow_termwise_eval(bool value) {
- _state.allow_termwise_eval(value);
- notifyChange();
- }
+ void set_allow_termwise_eval(bool value);
void set_want_global_filter(bool value);
void set_tree_size(uint32_t value);
- LeafBlueprint(bool allow_termwise_eval) noexcept
+ LeafBlueprint(bool allow_termwise_eval)
: _state()
{
_state.allow_termwise_eval(allow_termwise_eval);
}
- LeafBlueprint(FieldSpecBase field, bool allow_termwise_eval) noexcept
+ LeafBlueprint(FieldSpecBase field, bool allow_termwise_eval)
: _state(field)
{
_state.allow_termwise_eval(allow_termwise_eval);
}
- LeafBlueprint(FieldSpecBaseList fields, bool allow_termwise_eval) noexcept
+ LeafBlueprint(FieldSpecBaseList fields, bool allow_termwise_eval)
: _state(std::move(fields))
{
_state.allow_termwise_eval(allow_termwise_eval);
@@ -392,7 +386,7 @@ protected:
public:
~LeafBlueprint() override = default;
const State &getState() const final { return _state; }
- void setDocIdLimit(uint32_t limit) noexcept final { Blueprint::setDocIdLimit(limit); }
+ void setDocIdLimit(uint32_t limit) final { Blueprint::setDocIdLimit(limit); }
void fetchPostings(const ExecuteInfo &execInfo) override;
void freeze() final;
SearchIteratorUP createSearch(fef::MatchData &md, bool strict) const override;
@@ -403,15 +397,15 @@ public:
// for leaf nodes representing a single term
struct SimpleLeafBlueprint : LeafBlueprint {
- explicit SimpleLeafBlueprint() noexcept : LeafBlueprint(true) {}
- explicit SimpleLeafBlueprint(FieldSpecBase field) noexcept : LeafBlueprint(field, true) {}
- explicit SimpleLeafBlueprint(FieldSpecBaseList fields) noexcept: LeafBlueprint(std::move(fields), true) {}
+ explicit SimpleLeafBlueprint() : LeafBlueprint(true) {}
+ explicit SimpleLeafBlueprint(FieldSpecBase field) : LeafBlueprint(field, true) {}
+ explicit SimpleLeafBlueprint(FieldSpecBaseList fields) : LeafBlueprint(std::move(fields), true) {}
};
// for leaf nodes representing more complex structures like wand/phrase
struct ComplexLeafBlueprint : LeafBlueprint {
- explicit ComplexLeafBlueprint(FieldSpecBase field) noexcept : LeafBlueprint(field, false) {}
- explicit ComplexLeafBlueprint(FieldSpecBaseList fields) noexcept : LeafBlueprint(std::move(fields), false) {}
+ explicit ComplexLeafBlueprint(FieldSpecBase field) : LeafBlueprint(field, false) {}
+ explicit ComplexLeafBlueprint(FieldSpecBaseList fields) : LeafBlueprint(std::move(fields), false) {}
};
//-----------------------------------------------------------------------------
diff --git a/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp b/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp
index cd1ddd5b92e..121591723e2 100644
--- a/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/field_spec.cpp
@@ -5,9 +5,9 @@
namespace search::queryeval {
-FieldSpecBase::FieldSpecBase(uint32_t fieldId, fef::TermFieldHandle handle, bool isFilter_) noexcept
- : _fieldId(fieldId | (isFilter_ ? 0x1000000u : 0)),
- _handle(handle)
+FieldSpecBase::FieldSpecBase(uint32_t fieldId, fef::TermFieldHandle handle, bool isFilter_) :
+ _fieldId(fieldId | (isFilter_ ? 0x1000000u : 0)),
+ _handle(handle)
{
assert(fieldId < 0x1000000); // Can be represented by 24 bits
}
diff --git a/searchlib/src/vespa/searchlib/queryeval/field_spec.h b/searchlib/src/vespa/searchlib/queryeval/field_spec.h
index c4cd1ac2de8..fd925fdf4ff 100644
--- a/searchlib/src/vespa/searchlib/queryeval/field_spec.h
+++ b/searchlib/src/vespa/searchlib/queryeval/field_spec.h
@@ -19,15 +19,15 @@ namespace search::queryeval {
class FieldSpecBase
{
public:
- FieldSpecBase(uint32_t fieldId, fef::TermFieldHandle handle, bool isFilter_ = false) noexcept;
+ FieldSpecBase(uint32_t fieldId, fef::TermFieldHandle handle, bool isFilter_ = false);
// resolve where to put match information for this term/field combination
fef::TermFieldMatchData *resolve(fef::MatchData &md) const;
const fef::TermFieldMatchData *resolve(const fef::MatchData &md) const;
- uint32_t getFieldId() const noexcept { return _fieldId & 0xffffff; }
- fef::TermFieldHandle getHandle() const noexcept { return _handle; }
+ uint32_t getFieldId() const { return _fieldId & 0xffffff; }
+ fef::TermFieldHandle getHandle() const { return _handle; }
/// a filter produces less detailed match data
- bool isFilter() const noexcept { return _fieldId & 0x1000000; }
+ bool isFilter() const { return _fieldId & 0x1000000; }
private:
uint32_t _fieldId; // field id in ranking framework
fef::TermFieldHandle _handle; // handle used when exposing match data to ranking framework
@@ -40,13 +40,13 @@ class FieldSpec : public FieldSpecBase
{
public:
FieldSpec(const vespalib::string & name, uint32_t fieldId,
- fef::TermFieldHandle handle, bool isFilter_ = false) noexcept
+ fef::TermFieldHandle handle, bool isFilter_ = false)
: FieldSpecBase(fieldId, handle, isFilter_),
_name(name)
{}
~FieldSpec();
- const vespalib::string & getName() const noexcept { return _name; }
+ const vespalib::string & getName() const { return _name; }
private:
vespalib::string _name; // field name
};
@@ -61,7 +61,7 @@ private:
List _list;
public:
- FieldSpecBaseList() noexcept = default;
+ FieldSpecBaseList() = default;
FieldSpecBaseList(FieldSpecBaseList &&) noexcept = default;
FieldSpecBaseList & operator=(FieldSpecBaseList &&) noexcept = default;
FieldSpecBaseList(const FieldSpecBaseList &) = default;
@@ -69,15 +69,15 @@ public:
~FieldSpecBaseList();
void reserve(size_t sz) { _list.reserve(sz); }
using const_iterator = const FieldSpecBase *;
- FieldSpecBaseList &add(const FieldSpecBase &spec) noexcept {
+ FieldSpecBaseList &add(const FieldSpecBase &spec) {
_list.push_back(spec);
return *this;
}
- bool empty() const noexcept { return _list.empty(); }
- size_t size() const noexcept { return _list.size(); }
- const_iterator begin() const noexcept { return _list.begin(); }
- const_iterator end() const noexcept { return _list.end(); }
- const FieldSpecBase &operator[](size_t i) const noexcept { return _list[i]; }
+ bool empty() const { return _list.empty(); }
+ size_t size() const { return _list.size(); }
+ const_iterator begin() const { return _list.begin(); }
+ const_iterator end() const { return _list.end(); }
+ const FieldSpecBase &operator[](size_t i) const { return _list[i]; }
};
/**
@@ -89,7 +89,7 @@ private:
vespalib::SmallVector<FieldSpec, 1> _list;
public:
- FieldSpecList() noexcept = default;
+ FieldSpecList() = default;
FieldSpecList(FieldSpecList &&) noexcept = delete;
FieldSpecList & operator=(FieldSpecList &&) noexcept = delete;
FieldSpecList(const FieldSpecList &) noexcept = delete;
@@ -99,9 +99,9 @@ public:
_list.push_back(spec);
return *this;
}
- bool empty() const noexcept { return _list.empty(); }
- size_t size() const noexcept { return _list.size(); }
- const FieldSpec &operator[](size_t i) const noexcept { return _list[i]; }
+ bool empty() const { return _list.empty(); }
+ size_t size() const { return _list.size(); }
+ const FieldSpec &operator[](size_t i) const { return _list[i]; }
void clear() { _list.clear(); }
};