summaryrefslogtreecommitdiffstats
path: root/searchcommon
diff options
context:
space:
mode:
authorGeir Storli <geirstorli@yahoo.no>2019-01-21 16:06:53 +0100
committerGitHub <noreply@github.com>2019-01-21 16:06:53 +0100
commit8372a883c5a5fa100f88fc9b80824359b5bb70cd (patch)
tree660ce3ef61f060b33bd97eac1185715606b8e2bd /searchcommon
parent3722c1cdd91fce30d1c2538b2a8749d9321e194b (diff)
parenteb0b1134a66507e3bd8f09793c22cd824d01dff5 (diff)
Merge pull request #8198 from vespa-engine/7
7 MERGEOK
Diffstat (limited to 'searchcommon')
-rw-r--r--searchcommon/src/tests/schema/load-save-cfg/indexschema.cfg11
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp22
-rw-r--r--searchcommon/src/vespa/searchcommon/common/undefinedvalues.h6
3 files changed, 9 insertions, 30 deletions
diff --git a/searchcommon/src/tests/schema/load-save-cfg/indexschema.cfg b/searchcommon/src/tests/schema/load-save-cfg/indexschema.cfg
index 989f30f7499..c0998bcf597 100644
--- a/searchcommon/src/tests/schema/load-save-cfg/indexschema.cfg
+++ b/searchcommon/src/tests/schema/load-save-cfg/indexschema.cfg
@@ -8,17 +8,6 @@ indexfield[2].datatype STRING
indexfield[2].prefix true
indexfield[2].phrases false
indexfield[2].positions false
-indexfield[3].name e
-indexfield[3].datatype BOOLEANTREE
-indexfield[3].collectiontype SINGLE
-indexfield[4].name f
-indexfield[4].indextype RISE
-indexfield[4].datatype STRING
-indexfield[4].collectiontype WEIGHTEDSET
-indexfield[5].name g
-indexfield[5].indextype RISE
-indexfield[5].datatype INT64
-indexfield[5].collectiontype WEIGHTEDSET
fieldset[1]
fieldset[0].name default
fieldset[0].field[2]
diff --git a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp
index 401003cb74b..d56f3c747c1 100644
--- a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp
+++ b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp
@@ -32,8 +32,6 @@ convertIndexDataType(const IndexschemaConfig::Indexfield::Datatype &type)
return DataType::STRING;
case IndexschemaConfig::Indexfield::INT64:
return DataType::INT64;
- case IndexschemaConfig::Indexfield::BOOLEANTREE:
- return DataType::BOOLEANTREE;
}
return DataType::STRING;
}
@@ -144,20 +142,12 @@ SchemaBuilder::build(const IndexschemaConfig &cfg, Schema &schema)
{
for (size_t i = 0; i < cfg.indexfield.size(); ++i) {
const IndexschemaConfig::Indexfield & f = cfg.indexfield[i];
- if ((f.datatype == IndexschemaConfig::Indexfield::BOOLEANTREE &&
- f.collectiontype == IndexschemaConfig::Indexfield::SINGLE) ||
- (f.indextype == IndexschemaConfig::Indexfield::RISE))
- {
- LOG(warning, "Your field '%s' is a rise index. Those are no longer supported as of Vespa-5.89.\n"
- " Redeploy and follow instructions to mitigate.", f.name.c_str());
- } else {
- schema.addIndexField(Schema::IndexField(f.name, convertIndexDataType(f.datatype),
- convertIndexCollectionType(f.collectiontype)).
- setPrefix(f.prefix).
- setPhrases(f.phrases).
- setPositions(f.positions).
- setAvgElemLen(f.averageelementlen));
- }
+ schema.addIndexField(Schema::IndexField(f.name, convertIndexDataType(f.datatype),
+ convertIndexCollectionType(f.collectiontype)).
+ setPrefix(f.prefix).
+ setPhrases(f.phrases).
+ setPositions(f.positions).
+ setAvgElemLen(f.averageelementlen));
}
for (size_t i = 0; i < cfg.fieldset.size(); ++i) {
const IndexschemaConfig::Fieldset &fs = cfg.fieldset[i];
diff --git a/searchcommon/src/vespa/searchcommon/common/undefinedvalues.h b/searchcommon/src/vespa/searchcommon/common/undefinedvalues.h
index 478cc680ea0..3185cad34bd 100644
--- a/searchcommon/src/vespa/searchcommon/common/undefinedvalues.h
+++ b/searchcommon/src/vespa/searchcommon/common/undefinedvalues.h
@@ -11,17 +11,17 @@ namespace attribute {
// for all integers
template <typename T>
-T getUndefined() {
+constexpr T getUndefined() {
return std::numeric_limits<T>::min();
}
template <>
-inline float getUndefined<float>() {
+inline constexpr float getUndefined<float>() {
return -std::numeric_limits<float>::quiet_NaN();
}
template <>
-inline double getUndefined<double>() {
+inline constexpr double getUndefined<double>() {
return -std::numeric_limits<double>::quiet_NaN();
}