summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configdefinitions/src/vespa/attributes.def2
-rw-r--r--searchcommon/src/tests/schema/schema_test.cpp9
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp20
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h47
-rw-r--r--searchcore/src/apps/tests/persistenceconformance_test.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/configconverter.cpp2
8 files changed, 55 insertions, 36 deletions
diff --git a/configdefinitions/src/vespa/attributes.def b/configdefinitions/src/vespa/attributes.def
index 344322d3873..f9db9eb2f0d 100644
--- a/configdefinitions/src/vespa/attributes.def
+++ b/configdefinitions/src/vespa/attributes.def
@@ -2,7 +2,7 @@
namespace=vespa.config.search
attribute[].name string
-attribute[].datatype enum { STRING, BOOL, UINT1, UINT2, UINT4, INT8, INT16, INT32, INT64, FLOAT16, FLOAT, DOUBLE, PREDICATE, TENSOR, REFERENCE, NONE } default=NONE
+attribute[].datatype enum { STRING, BOOL, UINT2, UINT4, INT8, INT16, INT32, INT64, FLOAT16, FLOAT, DOUBLE, PREDICATE, TENSOR, REFERENCE, NONE } default=NONE
attribute[].collectiontype enum { SINGLE, ARRAY, WEIGHTEDSET } default=SINGLE
attribute[].removeifzero bool default=false
attribute[].createifnonexistent bool default=false
diff --git a/searchcommon/src/tests/schema/schema_test.cpp b/searchcommon/src/tests/schema/schema_test.cpp
index 8a70e4f12df..e9997c2e70d 100644
--- a/searchcommon/src/tests/schema/schema_test.cpp
+++ b/searchcommon/src/tests/schema/schema_test.cpp
@@ -1,16 +1,16 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
#include <vespa/vespalib/stllike/string.h>
#include <fstream>
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/config/common/configparser.h>
#include <vespa/searchcommon/common/schemaconfigurer.h>
+#include <vespa/searchcommon/common/schema.h>
+#include <vespa/log/log.h>
LOG_SETUP("schema_test");
using vespalib::string;
-namespace search {
-namespace index {
+namespace search::index {
using schema::DataType;
using schema::CollectionType;
@@ -426,7 +426,6 @@ TEST("require that schema can be built with imported attribute fields")
TEST_DO(assertField(SIAF("regular", DataType::INT32, CollectionType::SINGLE), regular[0]));
}
-} // namespace index
-} // namespace search
+}
TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp
index cae2299132f..e7f103f0ebb 100644
--- a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp
+++ b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.cpp
@@ -1,6 +1,14 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "schemaconfigurer.h"
+#include <vespa/config-attributes.h>
+#include <vespa/config-imported-fields.h>
+#include <vespa/config-indexschema.h>
+#include <vespa/config-summary.h>
+#include <vespa/searchcommon/common/schema.h>
+#include <vespa/searchcommon/attribute/collectiontype.h>
+#include <vespa/searchcommon/attribute/basictype.h>
+
#include <vespa/searchcommon/config/subscriptionproxyng.h>
#include <vespa/log/log.h>
@@ -9,8 +17,7 @@ LOG_SETUP(".index.schemaconfigurer");
using namespace config;
using namespace vespa::config::search;
-namespace search {
-namespace index {
+namespace search::index {
using schema::DataType;
using schema::CollectionType;
@@ -53,7 +60,7 @@ convertDataType(const ConfigType &type)
switch (type) {
case ConfigType::STRING:
return DataType::STRING;
- case ConfigType::UINT1:
+ case ConfigType::BOOL:
return DataType::UINT1;
case ConfigType::UINT2:
return DataType::UINT2;
@@ -228,8 +235,7 @@ SchemaConfigurer::configure(const SummaryConfig & cfg)
SchemaBuilder::build(cfg, _schema);
}
-SchemaConfigurer::SchemaConfigurer(Schema &schema,
- const vespalib::string &configId)
+SchemaConfigurer::SchemaConfigurer(Schema &schema, const vespalib::string &configId)
: _schema(schema)
{
search::SubscriptionProxyNg<SchemaConfigurer, IndexschemaConfig>
@@ -243,6 +249,4 @@ SchemaConfigurer::SchemaConfigurer(Schema &schema,
summarySubscriber.subscribe(configId.c_str());
}
-
-} // namespace search::index
-} // namespace search
+}
diff --git a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h
index e1999e45296..75d75bc256b 100644
--- a/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h
+++ b/searchcommon/src/vespa/searchcommon/common/schemaconfigurer.h
@@ -2,16 +2,17 @@
#pragma once
-#include <vespa/config-attributes.h>
-#include <vespa/config-imported-fields.h>
-#include <vespa/config-indexschema.h>
-#include <vespa/config-summary.h>
-#include <vespa/searchcommon/common/schema.h>
-#include <vespa/searchcommon/attribute/collectiontype.h>
-#include <vespa/searchcommon/attribute/basictype.h>
+#include <vespa/vespalib/stllike/string.h>
-namespace search {
-namespace index {
+namespace vespa::config::search::internal {
+ class InternalIndexschemaType;
+ class InternalAttributesType;
+ class InternalSummaryType;
+}
+
+namespace search::index {
+
+class Schema;
/**
* Schema class used to give a high-level description of the content
@@ -20,34 +21,40 @@ namespace index {
class SchemaBuilder
{
public:
+ using IndexschemaConfig = const vespa::config::search::internal::InternalIndexschemaType;
+ using AttributesConfig = const vespa::config::search::internal::InternalAttributesType;
+ using SummaryConfig = const vespa::config::search::internal::InternalSummaryType;
/**
* Build from indexschema config.
*
- * @param indexCfg vespa::config::search::IndexschemaConfig to use
+ * @param indexCfg IndexschemaConfig to use
*/
- static void build(const vespa::config::search::IndexschemaConfig &cfg, Schema &schema);
+ static void build(const IndexschemaConfig &cfg, Schema &schema);
/**
* Build from attribute config.
*
- * @param attributeCfg vespa::config::search::AttributesConfig to use
+ * @param attributeCfg AttributesConfig to use
**/
- static void build(const vespa::config::search::AttributesConfig &cfg, Schema &schema);
+ static void build(const AttributesConfig &cfg, Schema &schema);
/**
* Build from summary config.
*
- * @param summaryCfg vespa::config::search::SummaryConfig to use
+ * @param summaryCfg SummaryConfig to use
**/
- static void build(const vespa::config::search::SummaryConfig &cfg, Schema &schema);
+ static void build(const SummaryConfig &cfg, Schema &schema);
};
class SchemaConfigurer
{
private:
+ using IndexschemaConfig = SchemaBuilder::IndexschemaConfig;
+ using AttributesConfig = SchemaBuilder::AttributesConfig;
+ using SummaryConfig = SchemaBuilder::SummaryConfig;
Schema & _schema;
- void configure(const vespa::config::search::IndexschemaConfig & cfg);
- void configure(const vespa::config::search::AttributesConfig & cfg);
- void configure(const vespa::config::search::SummaryConfig & cfg);
+ void configure(const IndexschemaConfig & cfg);
+ void configure(const AttributesConfig & cfg);
+ void configure(const SummaryConfig & cfg);
public:
/**
@@ -58,6 +65,4 @@ public:
SchemaConfigurer(Schema & schema, const vespalib::string &configId);
};
-} // namespace search::index
-} // namespace search
-
+}
diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp
index 828ca384bc5..52ba963ff01 100644
--- a/searchcore/src/apps/tests/persistenceconformance_test.cpp
+++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp
@@ -28,6 +28,9 @@
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/config-bucketspaces.h>
+#include <vespa/config-attributes.h>
+#include <vespa/config-indexschema.h>
+#include <vespa/config-summary.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/log/log.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
index 99c4cfb8130..0429ccb4a61 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdbconfigmanager.cpp
@@ -9,6 +9,10 @@
#include <vespa/config-summarymap.h>
#include <vespa/config/file_acquirer/file_acquirer.h>
#include <vespa/config/helper/legacy.h>
+#include <vespa/config-attributes.h>
+#include <vespa/config-imported-fields.h>
+#include <vespa/config-indexschema.h>
+#include <vespa/config-summary.h>
#include <vespa/searchcommon/common/schemaconfigurer.h>
#include <vespa/searchlib/index/schemautil.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
index 72f48df3295..9208daf5f26 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
@@ -12,6 +12,10 @@
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/config-summarymap.h>
#include <vespa/config-rank-profiles.h>
+#include <vespa/config-attributes.h>
+#include <vespa/config-imported-fields.h>
+#include <vespa/config-indexschema.h>
+#include <vespa/config-summary.h>
#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/config/helper/configgetter.hpp>
#include <sstream>
diff --git a/searchlib/src/vespa/searchlib/attribute/configconverter.cpp b/searchlib/src/vespa/searchlib/attribute/configconverter.cpp
index 5c1e0e09b62..963d7bf5ae9 100644
--- a/searchlib/src/vespa/searchlib/attribute/configconverter.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/configconverter.cpp
@@ -20,7 +20,7 @@ getDataTypeMap()
{
DataTypeMap map;
map[AttributesConfig::Attribute::STRING] = BasicType::STRING;
- map[AttributesConfig::Attribute::UINT1] = BasicType::UINT1;
+ map[AttributesConfig::Attribute::BOOL] = BasicType::UINT1;
map[AttributesConfig::Attribute::UINT2] = BasicType::UINT2;
map[AttributesConfig::Attribute::UINT4] = BasicType::UINT4;
map[AttributesConfig::Attribute::INT8] = BasicType::INT8;