aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp38
-rw-r--r--searchcore/src/tests/proton/common/cachedselect_test.cpp51
-rw-r--r--searchcore/src/tests/proton/common/schemautil_test.cpp16
-rw-r--r--searchcore/src/tests/proton/common/selectpruner_test.cpp34
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp100
-rw-r--r--searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp27
-rw-r--r--searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp38
-rw-r--r--searchcore/src/tests/proton/documentdb/configvalidator/configvalidator_test.cpp170
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp9
-rw-r--r--searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp20
-rw-r--r--searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp10
-rw-r--r--searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp2
-rw-r--r--searchcore/src/tests/proton/index/fusionrunner_test.cpp22
-rw-r--r--searchcore/src/tests/proton/index/indexmanager_test.cpp24
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp14
-rw-r--r--searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp9
-rw-r--r--searchcore/src/tests/proton/server/documentretriever_test.cpp96
-rw-r--r--searchcore/src/tests/proton/server/memoryconfigstore_test.cpp14
-rw-r--r--searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp15
19 files changed, 368 insertions, 341 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index 526358f65f5..57aa987ada2 100644
--- a/searchcore/src/tests/proton/attribute/attribute_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp
@@ -40,18 +40,20 @@ LOG_SETUP("attribute_test");
namespace vespa { namespace config { namespace search {}}}
-using std::string;
-using namespace vespa::config::search;
using namespace config;
using namespace document;
using namespace proton;
-using namespace search;
using namespace search::index;
-using search::tensor::TensorAttribute;
+using namespace search;
+using namespace vespa::config::search;
+
using search::TuneFileAttributes;
using search::index::DummyFileHeaderContext;
-using search::predicate::PredicateIndex;
+using search::index::schema::CollectionType;
using search::predicate::PredicateHash;
+using search::predicate::PredicateIndex;
+using search::tensor::TensorAttribute;
+using std::string;
using vespalib::eval::ValueType;
using vespalib::tensor::Tensor;
using vespalib::tensor::TensorCells;
@@ -139,10 +141,10 @@ struct Fixture
TEST_F("require that attribute adapter handles put", Fixture)
{
Schema s;
- s.addAttributeField(Schema::AttributeField("a1", schema::INT32, schema::SINGLE));
- s.addAttributeField(Schema::AttributeField("a2", schema::INT32, schema::ARRAY));
- s.addAttributeField(Schema::AttributeField("a3", schema::FLOAT, schema::SINGLE));
- s.addAttributeField(Schema::AttributeField("a4", schema::STRING, schema::SINGLE));
+ s.addAttributeField(Schema::AttributeField("a1", schema::DataType::INT32, CollectionType::SINGLE));
+ s.addAttributeField(Schema::AttributeField("a2", schema::DataType::INT32, CollectionType::ARRAY));
+ s.addAttributeField(Schema::AttributeField("a3", schema::DataType::FLOAT, CollectionType::SINGLE));
+ s.addAttributeField(Schema::AttributeField("a4", schema::DataType::STRING, CollectionType::SINGLE));
DocBuilder idb(s);
@@ -233,7 +235,7 @@ TEST_F("require that attribute adapter handles put", Fixture)
TEST_F("require that attribute adapter handles predicate put", Fixture)
{
Schema s;
- s.addAttributeField(Schema::AttributeField("a1", schema::BOOLEANTREE, schema::SINGLE));
+ s.addAttributeField(Schema::AttributeField("a1", schema::DataType::BOOLEANTREE, CollectionType::SINGLE));
DocBuilder idb(s);
proton::AttributeManager & am = *f._m;
@@ -281,8 +283,8 @@ TEST_F("require that attribute adapter handles remove", Fixture)
AttributeVector::SP a1 = f.addAttribute("a1");
AttributeVector::SP a2 = f.addAttribute("a2");
Schema s;
- s.addAttributeField(Schema::AttributeField("a1", schema::INT32, schema::SINGLE));
- s.addAttributeField(Schema::AttributeField("a2", schema::INT32, schema::SINGLE));
+ s.addAttributeField(Schema::AttributeField("a1", schema::DataType::INT32, CollectionType::SINGLE));
+ s.addAttributeField(Schema::AttributeField("a2", schema::DataType::INT32, CollectionType::SINGLE));
DocBuilder idb(s);
@@ -319,7 +321,7 @@ TEST_F("require that visibilitydelay is honoured", Fixture)
AVConfig(AVBasicType::STRING),
createSerialNum);
Schema s;
- s.addAttributeField(Schema::AttributeField("a1", schema::STRING, schema::SINGLE));
+ s.addAttributeField(Schema::AttributeField("a1", schema::DataType::STRING, CollectionType::SINGLE));
DocBuilder idb(s);
EXPECT_EQUAL(1u, a1->getNumDocs());
EXPECT_EQUAL(0u, a1->getStatus().getLastSyncToken());
@@ -369,7 +371,7 @@ TEST_F("require that attribute adapter handles predicate remove", Fixture)
createSerialNum);
Schema s;
s.addAttributeField(
- Schema::AttributeField("a1", schema::BOOLEANTREE, schema::SINGLE));
+ Schema::AttributeField("a1", schema::DataType::BOOLEANTREE, CollectionType::SINGLE));
DocBuilder idb(s);
PredicateSlimeBuilder builder;
@@ -395,8 +397,8 @@ TEST_F("require that attribute adapter handles update", Fixture)
fillAttribute(a2, 1, 20, 1);
Schema schema;
- schema.addAttributeField(Schema::AttributeField("a1", schema::INT32, schema::SINGLE));
- schema.addAttributeField(Schema::AttributeField("a2", schema::INT32, schema::SINGLE));
+ schema.addAttributeField(Schema::AttributeField("a1", schema::DataType::INT32, CollectionType::SINGLE));
+ schema.addAttributeField(Schema::AttributeField("a2", schema::DataType::INT32, CollectionType::SINGLE));
DocBuilder idb(schema);
const document::DocumentType &dt(idb.getDocumentType());
DocumentUpdate upd(dt, DocumentId("doc::1"));
@@ -433,7 +435,7 @@ TEST_F("require that attribute adapter handles predicate update", Fixture)
AVConfig(AVBasicType::PREDICATE),
createSerialNum);
Schema schema;
- schema.addAttributeField(Schema::AttributeField("a1", schema::BOOLEANTREE, schema::SINGLE));
+ schema.addAttributeField(Schema::AttributeField("a1", schema::DataType::BOOLEANTREE, CollectionType::SINGLE));
DocBuilder idb(schema);
PredicateSlimeBuilder builder;
@@ -577,7 +579,7 @@ createTensorAttribute(Fixture &f) {
Schema
createTensorSchema() {
Schema schema;
- schema.addAttributeField(Schema::AttributeField("a1", schema::TENSOR, schema::SINGLE));
+ schema.addAttributeField(Schema::AttributeField("a1", schema::DataType::TENSOR, CollectionType::SINGLE));
return schema;
}
diff --git a/searchcore/src/tests/proton/common/cachedselect_test.cpp b/searchcore/src/tests/proton/common/cachedselect_test.cpp
index da549cc7be0..d82eaa747db 100644
--- a/searchcore/src/tests/proton/common/cachedselect_test.cpp
+++ b/searchcore/src/tests/proton/common/cachedselect_test.cpp
@@ -27,39 +27,40 @@
#include <vespa/log/log.h>
LOG_SETUP("cachedselect_test");
-using search::index::Schema;
-using document::DocumentTypeRepo;
-using document::DocumentType;
-using document::select::Node;
-using document::select::Result;
-using document::select::ResultSet;
-using document::select::CloningVisitor;
-using document::select::Context;
-using vespalib::string;
-
-using document::config_builder::DocumenttypesConfigBuilderHelper;
-using document::config_builder::Struct;
-using document::config_builder::Array;
-using document::config_builder::Wset;
-using document::config_builder::Map;
using document::DataType;
using document::Document;
using document::DocumentId;
-using document::StringFieldValue;
+using document::DocumentType;
+using document::DocumentTypeRepo;
using document::IntFieldValue;
+using document::StringFieldValue;
+using document::config_builder::Array;
+using document::config_builder::DocumenttypesConfigBuilderHelper;
+using document::config_builder::Map;
+using document::config_builder::Struct;
+using document::config_builder::Wset;
+using document::select::CloningVisitor;
+using document::select::Context;
+using document::select::Node;
+using document::select::Result;
+using document::select::ResultSet;
using proton::CachedSelect;
using proton::SelectContext;
-using search::AttributeVector;
-using search::AttributeGuard;
-using search::AttributeEnumGuard;
using search::AttributeContext;
-using search::EnumAttribute;
+using search::AttributeEnumGuard;
+using search::AttributeGuard;
using search::AttributePosting;
-using search::SingleValueNumericPostingAttribute;
+using search::AttributeVector;
+using search::EnumAttribute;
using search::IntegerAttribute;
using search::IntegerAttributeTemplate;
+using search::SingleValueNumericPostingAttribute;
using search::attribute::IAttributeContext;
using search::attribute::test::MockAttributeManager;
+using search::index::Schema;
+using search::index::schema::CollectionType;
+using vespalib::string;
+
using namespace search::index;
typedef Node::UP NodeUP;
@@ -77,10 +78,10 @@ namespace {
void
makeSchema(Schema &s)
{
- s.addIndexField(Schema::IndexField("ia", schema::STRING));
- s.addAttributeField(Schema::AttributeField("aa", schema::INT32));
- s.addAttributeField(Schema::AttributeField("aaa", schema::INT32, schema::ARRAY));
- s.addAttributeField(Schema::AttributeField("aaw", schema::INT32, schema::WEIGHTEDSET));
+ s.addIndexField(Schema::IndexField("ia", schema::DataType::STRING));
+ s.addAttributeField(Schema::AttributeField("aa", schema::DataType::INT32));
+ s.addAttributeField(Schema::AttributeField("aaa", schema::DataType::INT32, CollectionType::ARRAY));
+ s.addAttributeField(Schema::AttributeField("aaw", schema::DataType::INT32, CollectionType::WEIGHTEDSET));
}
const int32_t doc_type_id = 787121340;
diff --git a/searchcore/src/tests/proton/common/schemautil_test.cpp b/searchcore/src/tests/proton/common/schemautil_test.cpp
index 465c7a2a3b0..d21582c5111 100644
--- a/searchcore/src/tests/proton/common/schemautil_test.cpp
+++ b/searchcore/src/tests/proton/common/schemautil_test.cpp
@@ -6,25 +6,27 @@
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/testkit/testapp.h>
+using namespace proton;
using namespace search::index;
+using search::index::schema::CollectionType;
+using search::index::schema::DataType;
using vespalib::string;
-using namespace proton;
namespace {
void addAllFieldTypes(const string &name, Schema &schema,
fastos::TimeStamp timestamp)
{
- Schema::IndexField index_field(name, schema::STRING);
+ Schema::IndexField index_field(name, DataType::STRING);
index_field.setTimestamp(timestamp);
schema.addIndexField(index_field);
- Schema::AttributeField attribute_field(name, schema::STRING);
+ Schema::AttributeField attribute_field(name, DataType::STRING);
attribute_field.setTimestamp(timestamp);
schema.addAttributeField(attribute_field);
- Schema::SummaryField summary_field(name, schema::STRING);
+ Schema::SummaryField summary_field(name, DataType::STRING);
summary_field.setTimestamp(timestamp);
schema.addSummaryField(summary_field);
}
@@ -109,9 +111,9 @@ assertSchemaResult(const vespalib::string &name,
TEST("require that listSchema can list all fields")
{
Schema schema;
- schema.addIndexField(Schema::IndexField("if", schema::STRING));
- schema.addAttributeField(Schema::AttributeField("af", schema::INT32));
- schema.addSummaryField(Schema::SummaryField("sf", schema::FLOAT, schema::ARRAY));
+ schema.addIndexField(Schema::IndexField("if", DataType::STRING));
+ schema.addAttributeField(Schema::AttributeField("af", DataType::INT32));
+ schema.addSummaryField(Schema::SummaryField("sf", DataType::FLOAT, CollectionType::ARRAY));
ListSchemaResult r;
SchemaUtil::listSchema(schema, r.fieldNames, r.fieldDataTypes, r.fieldCollectionTypes, r.fieldLocations);
diff --git a/searchcore/src/tests/proton/common/selectpruner_test.cpp b/searchcore/src/tests/proton/common/selectpruner_test.cpp
index 7bea3ee12e0..7199cda27d6 100644
--- a/searchcore/src/tests/proton/common/selectpruner_test.cpp
+++ b/searchcore/src/tests/proton/common/selectpruner_test.cpp
@@ -12,22 +12,22 @@
LOG_SETUP("selectpruner_test");
using namespace search::index;
-using document::DocumentTypeRepo;
+using document::DataType;
+using document::Document;
using document::DocumentType;
-using document::select::Node;
-using document::select::Result;
-using document::select::ResultSet;
-using document::select::CloningVisitor;
-using vespalib::string;
-
+using document::DocumentTypeRepo;
+using document::config_builder::Array;
using document::config_builder::DocumenttypesConfigBuilderHelper;
+using document::config_builder::Map;
using document::config_builder::Struct;
-using document::config_builder::Array;
using document::config_builder::Wset;
-using document::config_builder::Map;
-using document::DataType;
-using document::Document;
+using document::select::CloningVisitor;
+using document::select::Node;
+using document::select::Result;
+using document::select::ResultSet;
using proton::SelectPruner;
+using search::index::schema::CollectionType;
+using vespalib::string;
typedef Node::UP NodeUP;
@@ -37,12 +37,12 @@ namespace
void
makeSchema(Schema &s)
{
- s.addIndexField(Schema::IndexField("ia", schema::STRING));
- s.addAttributeField(Schema::AttributeField("aa", schema::INT32));
- s.addAttributeField(Schema::AttributeField("aaa", schema::INT32,
- schema::ARRAY));
- s.addAttributeField(Schema::AttributeField("aaw", schema::INT32,
- schema::WEIGHTEDSET));
+ s.addIndexField(Schema::IndexField("ia", schema::DataType::STRING));
+ s.addAttributeField(Schema::AttributeField("aa", schema::DataType::INT32));
+ s.addAttributeField(Schema::AttributeField("aaa", schema::DataType::INT32,
+ CollectionType::ARRAY));
+ s.addAttributeField(Schema::AttributeField("aaw", schema::DataType::INT32,
+ CollectionType::WEIGHTEDSET));
}
const int32_t doc_type_id = 787121340;
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 411730ce188..05f335f374c 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -29,17 +29,19 @@
#include <vespa/log/log.h>
LOG_SETUP("docsummary_test");
+using namespace cloud::config::filedistribution;
using namespace document;
-using namespace search;
using namespace search::docsummary;
using namespace search::engine;
using namespace search::index;
using namespace search::transactionlog;
-using namespace cloud::config::filedistribution;
-using search::TuneFileDocumentDB;
+using namespace search;
+
using document::DocumenttypesConfig;
-using storage::spi::Timestamp;
+using search::TuneFileDocumentDB;
using search::index::DummyFileHeaderContext;
+using search::index::schema::CollectionType;
+using storage::spi::Timestamp;
using vespa::config::search::core::ProtonConfig;
using vespalib::tensor::Tensor;
using vespalib::tensor::TensorCells;
@@ -490,18 +492,18 @@ void
Test::requireThatAdapterHandlesAllFieldTypes()
{
Schema s;
- s.addSummaryField(Schema::SummaryField("a", schema::INT8));
- s.addSummaryField(Schema::SummaryField("b", schema::INT16));
- s.addSummaryField(Schema::SummaryField("c", schema::INT32));
- s.addSummaryField(Schema::SummaryField("d", schema::INT64));
- s.addSummaryField(Schema::SummaryField("e", schema::FLOAT));
- s.addSummaryField(Schema::SummaryField("f", schema::DOUBLE));
- s.addSummaryField(Schema::SummaryField("g", schema::STRING));
- s.addSummaryField(Schema::SummaryField("h", schema::STRING));
- s.addSummaryField(Schema::SummaryField("i", schema::RAW));
- s.addSummaryField(Schema::SummaryField("j", schema::RAW));
- s.addSummaryField(Schema::SummaryField("k", schema::STRING));
- s.addSummaryField(Schema::SummaryField("l", schema::STRING));
+ s.addSummaryField(Schema::SummaryField("a", schema::DataType::INT8));
+ s.addSummaryField(Schema::SummaryField("b", schema::DataType::INT16));
+ s.addSummaryField(Schema::SummaryField("c", schema::DataType::INT32));
+ s.addSummaryField(Schema::SummaryField("d", schema::DataType::INT64));
+ s.addSummaryField(Schema::SummaryField("e", schema::DataType::FLOAT));
+ s.addSummaryField(Schema::SummaryField("f", schema::DataType::DOUBLE));
+ s.addSummaryField(Schema::SummaryField("g", schema::DataType::STRING));
+ s.addSummaryField(Schema::SummaryField("h", schema::DataType::STRING));
+ s.addSummaryField(Schema::SummaryField("i", schema::DataType::RAW));
+ s.addSummaryField(Schema::SummaryField("j", schema::DataType::RAW));
+ s.addSummaryField(Schema::SummaryField("k", schema::DataType::STRING));
+ s.addSummaryField(Schema::SummaryField("l", schema::DataType::STRING));
BuildContext bc(s);
bc._bld.startDocument("doc::0");
@@ -550,7 +552,7 @@ void
Test::requireThatAdapterHandlesMultipleDocuments()
{
Schema s;
- s.addSummaryField(Schema::SummaryField("a", schema::INT32));
+ s.addSummaryField(Schema::SummaryField("a", schema::DataType::INT32));
BuildContext bc(s);
bc._bld.startDocument("doc::0").
@@ -592,7 +594,7 @@ void
Test::requireThatAdapterHandlesDocumentIdField()
{
Schema s;
- s.addSummaryField(Schema::SummaryField("documentid", schema::STRING));
+ s.addSummaryField(Schema::SummaryField("documentid", schema::DataType::STRING));
BuildContext bc(s);
bc._bld.startDocument("doc::0").
startSummaryField("documentid").
@@ -619,7 +621,7 @@ void
Test::requireThatDocsumRequestIsProcessed()
{
Schema s;
- s.addSummaryField(Schema::SummaryField("a", schema::INT32));
+ s.addSummaryField(Schema::SummaryField("a", schema::DataType::INT32));
BuildContext bc(s);
DBContext dc(bc._repo, getDocTypeName());
@@ -678,8 +680,8 @@ void
Test::requireThatRewritersAreUsed()
{
Schema s;
- s.addSummaryField(Schema::SummaryField("aa", schema::INT32));
- s.addSummaryField(Schema::SummaryField("ab", schema::INT32));
+ s.addSummaryField(Schema::SummaryField("aa", schema::DataType::INT32));
+ s.addSummaryField(Schema::SummaryField("ab", schema::DataType::INT32));
BuildContext bc(s);
DBContext dc(bc._repo, getDocTypeName());
@@ -717,16 +719,16 @@ void
Test::requireThatAttributesAreUsed()
{
Schema s;
- addField(s, "ba", schema::INT32, schema::SINGLE);
- addField(s, "bb", schema::FLOAT, schema::SINGLE);
- addField(s, "bc", schema::STRING, schema::SINGLE);
- addField(s, "bd", schema::INT32, schema::ARRAY);
- addField(s, "be", schema::FLOAT, schema::ARRAY);
- addField(s, "bf", schema::STRING, schema::ARRAY);
- addField(s, "bg", schema::INT32, schema::WEIGHTEDSET);
- addField(s, "bh", schema::FLOAT, schema::WEIGHTEDSET);
- addField(s, "bi", schema::STRING, schema::WEIGHTEDSET);
- addField(s, "bj", schema::TENSOR, schema::SINGLE);
+ addField(s, "ba", schema::DataType::INT32, CollectionType::SINGLE);
+ addField(s, "bb", schema::DataType::FLOAT, CollectionType::SINGLE);
+ addField(s, "bc", schema::DataType::STRING, CollectionType::SINGLE);
+ addField(s, "bd", schema::DataType::INT32, CollectionType::ARRAY);
+ addField(s, "be", schema::DataType::FLOAT, CollectionType::ARRAY);
+ addField(s, "bf", schema::DataType::STRING, CollectionType::ARRAY);
+ addField(s, "bg", schema::DataType::INT32, CollectionType::WEIGHTEDSET);
+ addField(s, "bh", schema::DataType::FLOAT, CollectionType::WEIGHTEDSET);
+ addField(s, "bi", schema::DataType::STRING, CollectionType::WEIGHTEDSET);
+ addField(s, "bj", schema::DataType::TENSOR, CollectionType::SINGLE);
BuildContext bc(s);
DBContext dc(bc._repo, getDocTypeName());
@@ -866,7 +868,7 @@ void
Test::requireThatSummaryAdapterHandlesPutAndRemove()
{
Schema s;
- s.addSummaryField(Schema::SummaryField("f1", schema::STRING, schema::SINGLE));
+ s.addSummaryField(Schema::SummaryField("f1", schema::DataType::STRING, CollectionType::SINGLE));
BuildContext bc(s);
DBContext dc(bc._repo, getDocTypeName());
Document::UP exp = bc._bld.startDocument("doc::1").
@@ -900,10 +902,10 @@ void
Test::requireThatAnnotationsAreUsed()
{
Schema s;
- s.addIndexField(Schema::IndexField("g", schema::STRING, schema::SINGLE));
- s.addSummaryField(Schema::SummaryField("g", schema::STRING, schema::SINGLE));
- s.addIndexField(Schema::IndexField("dynamicstring", schema::STRING, schema::SINGLE));
- s.addSummaryField(Schema::SummaryField("dynamicstring", schema::STRING, schema::SINGLE));
+ s.addIndexField(Schema::IndexField("g", schema::DataType::STRING, CollectionType::SINGLE));
+ s.addSummaryField(Schema::SummaryField("g", schema::DataType::STRING, CollectionType::SINGLE));
+ s.addIndexField(Schema::IndexField("dynamicstring", schema::DataType::STRING, CollectionType::SINGLE));
+ s.addSummaryField(Schema::SummaryField("dynamicstring", schema::DataType::STRING, CollectionType::SINGLE));
BuildContext bc(s);
DBContext dc(bc._repo, getDocTypeName());
Document::UP exp = bc._bld.startDocument("doc::0").
@@ -953,12 +955,12 @@ void
Test::requireThatUrisAreUsed()
{
Schema s;
- s.addUriIndexFields(Schema::IndexField("urisingle", schema::STRING, schema::SINGLE));
- s.addSummaryField(Schema::SummaryField("urisingle", schema::STRING, schema::SINGLE));
- s.addUriIndexFields(Schema::IndexField("uriarray", schema::STRING, schema::ARRAY));
- s.addSummaryField(Schema::SummaryField("uriarray", schema::STRING, schema::ARRAY));
- s.addUriIndexFields(Schema::IndexField("uriwset", schema::STRING, schema::WEIGHTEDSET));
- s.addSummaryField(Schema::SummaryField("uriwset", schema::STRING, schema::WEIGHTEDSET));
+ s.addUriIndexFields(Schema::IndexField("urisingle", schema::DataType::STRING, CollectionType::SINGLE));
+ s.addSummaryField(Schema::SummaryField("urisingle", schema::DataType::STRING, CollectionType::SINGLE));
+ s.addUriIndexFields(Schema::IndexField("uriarray", schema::DataType::STRING, CollectionType::ARRAY));
+ s.addSummaryField(Schema::SummaryField("uriarray", schema::DataType::STRING, CollectionType::ARRAY));
+ s.addUriIndexFields(Schema::IndexField("uriwset", schema::DataType::STRING, CollectionType::WEIGHTEDSET));
+ s.addSummaryField(Schema::SummaryField("uriwset", schema::DataType::STRING, CollectionType::WEIGHTEDSET));
BuildContext bc(s);
DBContext dc(bc._repo, getDocTypeName());
Document::UP exp = bc._bld.startDocument("doc::0").
@@ -1127,9 +1129,9 @@ void
Test::requireThatPositionsAreUsed()
{
Schema s;
- s.addAttributeField(Schema::AttributeField("sp2", schema::INT64));
- s.addAttributeField(Schema::AttributeField("ap2", schema::INT64, schema::ARRAY));
- s.addAttributeField(Schema::AttributeField("wp2", schema::INT64, schema::WEIGHTEDSET));
+ s.addAttributeField(Schema::AttributeField("sp2", schema::DataType::INT64));
+ s.addAttributeField(Schema::AttributeField("ap2", schema::DataType::INT64, CollectionType::ARRAY));
+ s.addAttributeField(Schema::AttributeField("wp2", schema::DataType::INT64, CollectionType::WEIGHTEDSET));
BuildContext bc(s);
DBContext dc(bc._repo, getDocTypeName());
@@ -1179,9 +1181,9 @@ void
Test::requireThatRawFieldsWorks()
{
Schema s;
- s.addSummaryField(Schema::AttributeField("i", schema::RAW));
- s.addSummaryField(Schema::AttributeField("araw", schema::RAW, schema::ARRAY));
- s.addSummaryField(Schema::AttributeField("wraw", schema::RAW, schema::WEIGHTEDSET));
+ s.addSummaryField(Schema::AttributeField("i", schema::DataType::RAW));
+ s.addSummaryField(Schema::AttributeField("araw", schema::DataType::RAW, CollectionType::ARRAY));
+ s.addSummaryField(Schema::AttributeField("wraw", schema::DataType::RAW, CollectionType::WEIGHTEDSET));
std::vector<char> binaryBlob;
binaryBlob.push_back('\0');
@@ -1267,7 +1269,7 @@ void
Test::requireThatFieldCacheRepoCanReturnDefaultFieldCache()
{
Schema s;
- s.addSummaryField(Schema::SummaryField("a", schema::INT32));
+ s.addSummaryField(Schema::SummaryField("a", schema::DataType::INT32));
BuildContext bc(s);
FieldCacheRepo::UP repo = bc.createFieldCacheRepo(getResultConfig());
FieldCache::CSP cache = repo->getFieldCache("");
diff --git a/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp b/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp
index f3f495925f0..13f0cd1cd2b 100644
--- a/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp
+++ b/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp
@@ -50,8 +50,6 @@
#include <vespa/eval/tensor/tensor_factory.h>
#include <vespa/vespalib/data/slime/slime.h>
-using vespa::config::search::SummarymapConfig;
-using vespa::config::search::SummarymapConfigBuilder;
using document::Annotation;
using document::AnnotationType;
using document::ArrayDataType;
@@ -59,11 +57,11 @@ using document::ArrayFieldValue;
using document::ByteFieldValue;
using document::DataType;
using document::Document;
-using document::DocumenttypesConfig;
-using document::DocumenttypesConfigBuilder;
using document::DocumentId;
using document::DocumentType;
using document::DocumentTypeRepo;
+using document::DocumenttypesConfig;
+using document::DocumenttypesConfigBuilder;
using document::DoubleFieldValue;
using document::FeatureSet;
using document::Field;
@@ -75,6 +73,8 @@ using document::LongFieldValue;
using document::Predicate;
using document::PredicateFieldValue;
using document::RawFieldValue;
+using document::ReferenceDataType;
+using document::ReferenceFieldValue;
using document::ShortFieldValue;
using document::Span;
using document::SpanList;
@@ -82,24 +82,25 @@ using document::SpanTree;
using document::StringFieldValue;
using document::StructDataType;
using document::StructFieldValue;
+using document::TensorFieldValue;
using document::UrlDataType;
using document::WeightedSetDataType;
using document::WeightedSetFieldValue;
-using document::TensorFieldValue;
-using document::ReferenceDataType;
-using document::ReferenceFieldValue;
using search::index::Schema;
-using vespalib::Slime;
-using vespalib::slime::Cursor;
-using vespalib::string;
using search::linguistics::SPANTREE_NAME;
using search::linguistics::TERM;
-using namespace search::docsummary;
+using vespa::config::search::SummarymapConfig;
+using vespa::config::search::SummarymapConfigBuilder;
+using vespalib::Slime;
using vespalib::geo::ZCurve;
+using vespalib::slime::Cursor;
+using vespalib::string;
using vespalib::tensor::Tensor;
using vespalib::tensor::TensorCells;
using vespalib::tensor::TensorDimensions;
+using namespace search::docsummary;
+
typedef SummaryFieldConverter SFC;
namespace {
@@ -481,11 +482,11 @@ void Test::checkArray(const char *(&str)[N], const FieldValue *value) {
}
void Test::setSummaryField(const string &field) {
- _schema->addSummaryField(Schema::Field(field, search::index::schema::STRING));
+ _schema->addSummaryField(Schema::Field(field, search::index::schema::DataType::STRING));
}
void Test::setAttributeField(const string &field) {
- _schema->addAttributeField(Schema::Field(field, search::index::schema::STRING));
+ _schema->addAttributeField(Schema::Field(field, search::index::schema::DataType::STRING));
}
void Test::requireThatSummaryIsAnUnmodifiedString() {
diff --git a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
index 95c444860b9..66035647d86 100644
--- a/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
+++ b/searchcore/src/tests/proton/document_iterator/document_iterator_test.cpp
@@ -15,37 +15,37 @@
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/testkit/test_kit.h>
-using document::DocumentType;
-using document::Field;
-using namespace proton;
-
+using document::BucketId;
using document::DataType;
using document::Document;
using document::DocumentId;
-using document::BucketId;
-using document::IntFieldValue;
+using document::DocumentType;
using document::DoubleFieldValue;
+using document::Field;
+using document::IntFieldValue;
using document::StringFieldValue;
-using search::DocumentIdT;
-using search::DocumentMetaData;
using search::AttributeContext;
using search::AttributeEnumGuard;
using search::AttributeGuard;
using search::AttributeVector;
+using search::DocumentIdT;
+using search::DocumentMetaData;
using search::attribute::BasicType;
using search::attribute::CollectionType;
using search::attribute::Config;
using search::attribute::IAttributeContext;
using search::attribute::test::MockAttributeManager;
-using namespace search::index;
-using storage::spi::Timestamp;
using storage::spi::Bucket;
-using storage::spi::PartitionId;
-using storage::spi::IterateResult;
using storage::spi::DocEntry;
-using storage::spi::Selection;
using storage::spi::DocumentSelection;
using storage::spi::IncludedVersions;
+using storage::spi::IterateResult;
+using storage::spi::PartitionId;
+using storage::spi::Selection;
+using storage::spi::Timestamp;
+
+using namespace proton;
+using namespace search::index;
const uint64_t largeNum = 10000000;
@@ -194,9 +194,9 @@ struct AttrUnitDR : public UnitDR
: UnitDR(d->getType(), document::Document::UP(d->clone()), t, b, r),
_amgr(), _schema(), _aa(), _dd(), _ss()
{
- createAttribute(_aa, BasicType::INT32, schema::INT32, "aa");
- createAttribute(_dd, BasicType::DOUBLE, schema::DOUBLE, "dd");
- createAttribute(_ss, BasicType::STRING, schema::STRING, "ss");
+ createAttribute(_aa, BasicType::INT32, schema::DataType::INT32, "aa");
+ createAttribute(_dd, BasicType::DOUBLE, schema::DataType::DOUBLE, "dd");
+ createAttribute(_ss, BasicType::STRING, schema::DataType::STRING, "ss");
}
AttrUnitDR(document::Document::UP d, Timestamp t, Bucket b, bool r,
@@ -204,11 +204,11 @@ struct AttrUnitDR : public UnitDR
: UnitDR(d->getType(), document::Document::UP(d->clone()), t, b, r),
_amgr(), _schema(), _aa(), _dd(), _ss()
{
- createAttribute(_aa, BasicType::INT32, schema::INT32, "aa");
+ createAttribute(_aa, BasicType::INT32, schema::DataType::INT32, "aa");
addAttribute<IntFieldValue, int32_t>(*_aa, aa);
- createAttribute(_dd, BasicType::DOUBLE, schema::DOUBLE, "dd");
+ createAttribute(_dd, BasicType::DOUBLE, schema::DataType::DOUBLE, "dd");
addAttribute<DoubleFieldValue, double>(*_dd, dd);
- createAttribute(_ss, BasicType::STRING, schema::STRING, "ss");
+ createAttribute(_ss, BasicType::STRING, schema::DataType::STRING, "ss");
addAttribute<StringFieldValue, vespalib::string>(*_ss, ss);
}
diff --git a/searchcore/src/tests/proton/documentdb/configvalidator/configvalidator_test.cpp b/searchcore/src/tests/proton/documentdb/configvalidator/configvalidator_test.cpp
index 6ca02a7a4c5..7fcdf4981bd 100644
--- a/searchcore/src/tests/proton/documentdb/configvalidator/configvalidator_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configvalidator/configvalidator_test.cpp
@@ -5,6 +5,11 @@
using namespace proton;
using namespace search::index;
+
+using proton::configvalidator::Result;
+using proton::configvalidator::ResultType;
+using search::index::schema::CollectionType;
+using search::index::schema::DataType;
using vespa::config::search::AttributesConfig;
using vespa::config::search::AttributesConfigBuilder;
@@ -12,9 +17,6 @@ typedef Schema::AttributeField AField;
typedef Schema::IndexField IField;
typedef Schema::SummaryField SField;
-using proton::configvalidator::ResultType;
-using proton::configvalidator::Result;
-
const ResultType OK = ResultType::OK;
const ResultType DTC = ResultType::DATA_TYPE_CHANGED;
const ResultType CTC = ResultType::COLLECTION_TYPE_CHANGED;
@@ -47,7 +49,7 @@ struct SchemaBuilder
Schema _schema;
SchemaBuilder() : _schema() {}
SchemaBuilder &add(const vespalib::string &name, FType ftype,
- schema::DataType dtype, schema::CollectionType ctype = schema::SINGLE) {
+ schema::DataType dtype, schema::CollectionType ctype = schema::CollectionType::SINGLE) {
switch (ftype) {
case INDEX:
_schema.addIndexField(IField(name, dtype, ctype));
@@ -74,13 +76,13 @@ create(FType ftype, Schema::DataType dtype, Schema::CollectionType ctype)
Schema
created(FType ftype, schema::DataType dtype)
{
- return create(ftype, dtype, schema::SINGLE);
+ return create(ftype, dtype, CollectionType::SINGLE);
}
Schema
createc(FType ftype, schema::CollectionType ctype)
{
- return create(ftype, schema::STRING, ctype);
+ return create(ftype, DataType::STRING, ctype);
}
ResultType
@@ -104,13 +106,13 @@ void
requireThatChangedDataTypeIsDiscovered(FType ftype)
{
EXPECT_EQUAL(DTC,
- checkSchema(created(ftype, schema::INT32),
- created(ftype, schema::STRING),
+ checkSchema(created(ftype, DataType::INT32),
+ created(ftype, DataType::STRING),
Schema()));
EXPECT_EQUAL(DTC,
- checkSchema(created(ftype, schema::INT32),
+ checkSchema(created(ftype, DataType::INT32),
Schema(),
- created(ftype, schema::STRING)));
+ created(ftype, DataType::STRING)));
}
TEST("require that changed data type is discovered")
@@ -124,13 +126,13 @@ void
requireThatChangedCollectionTypeIsDiscovered(FType ftype)
{
EXPECT_EQUAL(CTC,
- checkSchema(createc(ftype, schema::ARRAY),
- createc(ftype, schema::SINGLE),
+ checkSchema(createc(ftype, CollectionType::ARRAY),
+ createc(ftype, CollectionType::SINGLE),
Schema()));
EXPECT_EQUAL(CTC,
- checkSchema(createc(ftype, schema::ARRAY),
+ checkSchema(createc(ftype, CollectionType::ARRAY),
Schema(),
- createc(ftype, schema::SINGLE)));
+ createc(ftype, CollectionType::SINGLE)));
}
TEST("require that changed collection type is discovered")
@@ -142,15 +144,15 @@ TEST("require that changed collection type is discovered")
TEST("require that changed index aspect is discovered")
{
- Schema s1 = created(SUMMARY, schema::STRING);
- s1.addIndexField(IField("f1", schema::STRING));
- Schema s2 = created(SUMMARY, schema::STRING);
- Schema s2h = created(INDEX, schema::STRING);
-
- Schema s3 = created(ATTRIBUTE, schema::STRING);
- s3.addIndexField(IField("f1", schema::STRING));
- Schema s4 = created(ATTRIBUTE, schema::STRING);
- Schema s4h = created(INDEX, schema::STRING);
+ Schema s1 = created(SUMMARY, DataType::STRING);
+ s1.addIndexField(IField("f1", DataType::STRING));
+ Schema s2 = created(SUMMARY, DataType::STRING);
+ Schema s2h = created(INDEX, DataType::STRING);
+
+ Schema s3 = created(ATTRIBUTE, DataType::STRING);
+ s3.addIndexField(IField("f1", DataType::STRING));
+ Schema s4 = created(ATTRIBUTE, DataType::STRING);
+ Schema s4h = created(INDEX, DataType::STRING);
{ // remove as index field
EXPECT_EQUAL(IAR, checkSchema(s2, s1, Schema()));
EXPECT_EQUAL(IAR, checkSchema(s2, Schema(), s1));
@@ -174,21 +176,21 @@ TEST("require that changed index aspect is discovered")
TEST("require that changed attribute aspect is discovered")
{
- Schema s1 = created(SUMMARY, schema::STRING);
- s1.addAttributeField(AField("f1", schema::STRING));
- Schema s2 = created(SUMMARY, schema::STRING);
- Schema s2h = created(ATTRIBUTE, schema::STRING);
-
- Schema s3 = created(INDEX, schema::STRING);
- s3.addAttributeField(AField("f1", schema::STRING));
- Schema s4 = created(INDEX, schema::STRING);
- Schema s4h = created(ATTRIBUTE, schema::STRING);
-
- Schema s5 = created(INDEX, schema::STRING);
- s5.addSummaryField(SField("f1", schema::STRING));
- s5.addAttributeField(AField("f1", schema::STRING));
- Schema s6 = created(INDEX, schema::STRING);
- s6.addSummaryField(SField("f1", schema::STRING));
+ Schema s1 = created(SUMMARY, DataType::STRING);
+ s1.addAttributeField(AField("f1", DataType::STRING));
+ Schema s2 = created(SUMMARY, DataType::STRING);
+ Schema s2h = created(ATTRIBUTE, DataType::STRING);
+
+ Schema s3 = created(INDEX, DataType::STRING);
+ s3.addAttributeField(AField("f1", DataType::STRING));
+ Schema s4 = created(INDEX, DataType::STRING);
+ Schema s4h = created(ATTRIBUTE, DataType::STRING);
+
+ Schema s5 = created(INDEX, DataType::STRING);
+ s5.addSummaryField(SField("f1", DataType::STRING));
+ s5.addAttributeField(AField("f1", DataType::STRING));
+ Schema s6 = created(INDEX, DataType::STRING);
+ s6.addSummaryField(SField("f1", DataType::STRING));
{ // remove as attribute field
EXPECT_EQUAL(AAR, checkSchema(s2, s1, Schema()));
EXPECT_EQUAL(AAR, checkSchema(s2, Schema(), s1));
@@ -214,15 +216,15 @@ TEST("require that changed attribute aspect is discovered")
TEST("require that changed summary aspect is allowed")
{
- Schema s1 = created(INDEX, schema::STRING);
- s1.addSummaryField(SField("f1", schema::STRING));
- Schema s2 = created(INDEX, schema::STRING);
- Schema s2h = created(SUMMARY, schema::STRING);
-
- Schema s3 = created(ATTRIBUTE, schema::STRING);
- s3.addSummaryField(SField("f1", schema::STRING));
- Schema s4 = created(ATTRIBUTE, schema::STRING);
- Schema s4h = created(SUMMARY, schema::STRING);
+ Schema s1 = created(INDEX, DataType::STRING);
+ s1.addSummaryField(SField("f1", DataType::STRING));
+ Schema s2 = created(INDEX, DataType::STRING);
+ Schema s2h = created(SUMMARY, DataType::STRING);
+
+ Schema s3 = created(ATTRIBUTE, DataType::STRING);
+ s3.addSummaryField(SField("f1", DataType::STRING));
+ Schema s4 = created(ATTRIBUTE, DataType::STRING);
+ Schema s4h = created(SUMMARY, DataType::STRING);
{ // remove as summary field
EXPECT_EQUAL(OK, checkSchema(s2, s1, Schema()));
EXPECT_EQUAL(IAA, checkSchema(s2, Schema(), s1));
@@ -242,16 +244,16 @@ TEST("require that changed summary aspect is allowed")
TEST("require that fields can be added and removed")
{
Schema e;
- Schema s1 = created(INDEX, schema::STRING);
- Schema s2 = created(ATTRIBUTE, schema::STRING);
- Schema s3 = created(SUMMARY, schema::STRING);
- Schema s4 = created(SUMMARY, schema::STRING);
- s4.addIndexField(IField("f1", schema::STRING));
- Schema s5 = created(SUMMARY, schema::STRING);
- s5.addAttributeField(AField("f1", schema::STRING));
- Schema s6 = created(SUMMARY, schema::STRING);
- s6.addIndexField(IField("f1", schema::STRING));
- s6.addAttributeField(AField("f1", schema::STRING));
+ Schema s1 = created(INDEX, DataType::STRING);
+ Schema s2 = created(ATTRIBUTE, DataType::STRING);
+ Schema s3 = created(SUMMARY, DataType::STRING);
+ Schema s4 = created(SUMMARY, DataType::STRING);
+ s4.addIndexField(IField("f1", DataType::STRING));
+ Schema s5 = created(SUMMARY, DataType::STRING);
+ s5.addAttributeField(AField("f1", DataType::STRING));
+ Schema s6 = created(SUMMARY, DataType::STRING);
+ s6.addIndexField(IField("f1", DataType::STRING));
+ s6.addAttributeField(AField("f1", DataType::STRING));
{ // addition of field
EXPECT_EQUAL(OK, checkSchema(s1, e, e));
EXPECT_EQUAL(OK, checkSchema(s2, e, e));
@@ -278,53 +280,53 @@ TEST("require that fields can be added and removed")
TEST("require that data type changed precedes collection type changed")
{
- Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING).
- add("f2", FType::INDEX, schema::STRING).schema();
- Schema news = SchemaBuilder().add("f1", FType::SUMMARY, schema::INT32).
- add("f2", FType::INDEX, schema::STRING, schema::ARRAY).schema();
+ Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::INDEX, DataType::STRING).schema();
+ Schema news = SchemaBuilder().add("f1", FType::SUMMARY, DataType::INT32).
+ add("f2", FType::INDEX, DataType::STRING, CollectionType::ARRAY).schema();
EXPECT_EQUAL(DTC, checkSchema(news, olds, Schema()));
}
TEST("require that collection type change precedes index aspect added")
{
- Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING).
- add("f2", FType::SUMMARY, schema::STRING).schema();
- Schema news = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING, schema::ARRAY).
- add("f2", FType::SUMMARY, schema::STRING).
- add("f2", FType::INDEX, schema::STRING).schema();
+ Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::SUMMARY, DataType::STRING).schema();
+ Schema news = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING, CollectionType::ARRAY).
+ add("f2", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::INDEX, DataType::STRING).schema();
EXPECT_EQUAL(CTC, checkSchema(news, olds, Schema()));
}
TEST("require that index aspect added precedes index aspect removed")
{
- Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING).
- add("f2", FType::SUMMARY, schema::STRING).
- add("f2", FType::INDEX, schema::STRING).schema();
- Schema news = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING).
- add("f1", FType::INDEX, schema::STRING).
- add("f2", FType::SUMMARY, schema::STRING).schema();
+ Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::INDEX, DataType::STRING).schema();
+ Schema news = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING).
+ add("f1", FType::INDEX, DataType::STRING).
+ add("f2", FType::SUMMARY, DataType::STRING).schema();
EXPECT_EQUAL(IAA, checkSchema(news, olds, Schema()));
}
TEST("require that index aspect removed precedes attribute aspect removed")
{
- Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING).
- add("f1", FType::INDEX, schema::STRING).
- add("f2", FType::SUMMARY, schema::STRING).
- add("f2", FType::ATTRIBUTE, schema::STRING).schema();
- Schema news = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING).
- add("f2", FType::SUMMARY, schema::STRING).schema();
+ Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING).
+ add("f1", FType::INDEX, DataType::STRING).
+ add("f2", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::ATTRIBUTE, DataType::STRING).schema();
+ Schema news = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::SUMMARY, DataType::STRING).schema();
EXPECT_EQUAL(IAR, checkSchema(news, olds, Schema()));
}
TEST("require that attribute aspect removed precedes attribute aspect added")
{
- Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING).
- add("f1", FType::ATTRIBUTE, schema::STRING).
- add("f2", FType::SUMMARY, schema::STRING).schema();
- Schema news = SchemaBuilder().add("f1", FType::SUMMARY, schema::STRING).
- add("f2", FType::SUMMARY, schema::STRING).
- add("f2", FType::ATTRIBUTE, schema::STRING).schema();
+ Schema olds = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING).
+ add("f1", FType::ATTRIBUTE, DataType::STRING).
+ add("f2", FType::SUMMARY, DataType::STRING).schema();
+ Schema news = SchemaBuilder().add("f1", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::SUMMARY, DataType::STRING).
+ add("f2", FType::ATTRIBUTE, DataType::STRING).schema();
EXPECT_EQUAL(AAR, checkSchema(news, olds, Schema()));
}
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index a33a5f147f2..e423fa4a4ab 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -36,8 +36,10 @@ using documentapi::DocumentReply;
using documentapi::RemoveDocumentReply;
using documentapi::UpdateDocumentReply;
using mbus::Reply;
-using namespace search::index;
using search::SerialNum;
+using search::index::schema::CollectionType;
+using search::index::schema::DataType;
+using search::makeLambdaTask;
using search::transactionlog::TransLogServer;
using storage::spi::PartitionId;
using storage::spi::RemoveResult;
@@ -49,8 +51,9 @@ using vespalib::ThreadStackExecutor;
using vespalib::ThreadStackExecutorBase;
using vespalib::makeClosure;
using vespalib::makeTask;
-using search::makeLambdaTask;
+
using namespace proton;
+using namespace search::index;
typedef std::unique_ptr<vespalib::CountDownLatch> CountDownLatchUP;
@@ -261,7 +264,7 @@ struct SchemaContext {
schema(new Schema()),
builder()
{
- schema->addIndexField(Schema::IndexField("i1", schema::STRING, schema::SINGLE));
+ schema->addIndexField(Schema::IndexField("i1", DataType::STRING, CollectionType::SINGLE));
builder.reset(new DocBuilder(*schema));
}
DocTypeName getDocType() const {
diff --git a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
index 42ddfa23eb6..ddfd84a27a8 100644
--- a/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedview/feedview_test.cpp
@@ -35,20 +35,20 @@
LOG_SETUP("feedview_test");
using document::BucketId;
-using document::DataType;
using document::Document;
using document::DocumentId;
using document::DocumentUpdate;
using documentapi::DocumentProtocol;
using documentapi::RemoveDocumentReply;
using fastos::TimeStamp;
-using namespace proton;
using proton::matching::SessionManager;
+using proton::test::MockGidToLidChangeHandler;
using search::AttributeVector;
using search::CacheStats;
using search::DocumentMetaData;
using search::SearchableStats;
-using namespace search::index;
+using search::index::schema::CollectionType;
+using search::index::schema::DataType;
using searchcorespi::IndexSearchable;
using storage::spi::BucketChecksum;
using storage::spi::BucketInfo;
@@ -56,7 +56,9 @@ using storage::spi::PartitionId;
using storage::spi::Timestamp;
using storage::spi::UpdateResult;
using vespalib::eval::ValueType;
-using proton::test::MockGidToLidChangeHandler;
+
+using namespace proton;
+using namespace search::index;
typedef SearchableFeedView::SerialNum SerialNum;
typedef search::DocumentIdT DocumentIdT;
@@ -437,11 +439,11 @@ SchemaContext::SchemaContext() :
_schema(new Schema()),
_builder()
{
- _schema->addIndexField(Schema::IndexField("i1", schema::STRING, schema::SINGLE));
- _schema->addAttributeField(Schema::AttributeField("a1", schema::STRING, schema::SINGLE));
- _schema->addAttributeField(Schema::AttributeField("a2", schema::BOOLEANTREE, schema::SINGLE));
- _schema->addAttributeField(Schema::AttributeField("a3", schema::TENSOR, schema::SINGLE));
- _schema->addSummaryField(Schema::SummaryField("s1", schema::STRING, schema::SINGLE));
+ _schema->addIndexField(Schema::IndexField("i1", DataType::STRING, CollectionType::SINGLE));
+ _schema->addAttributeField(Schema::AttributeField("a1", DataType::STRING, CollectionType::SINGLE));
+ _schema->addAttributeField(Schema::AttributeField("a2", DataType::BOOLEANTREE, CollectionType::SINGLE));
+ _schema->addAttributeField(Schema::AttributeField("a3", DataType::TENSOR, CollectionType::SINGLE));
+ _schema->addSummaryField(Schema::SummaryField("s1", DataType::STRING, CollectionType::SINGLE));
_builder.reset(new DocBuilder(*_schema));
}
SchemaContext::~SchemaContext() {}
diff --git a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
index a4f4d729beb..579e33250b3 100644
--- a/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/fileconfigmanager/fileconfigmanager_test.cpp
@@ -16,6 +16,7 @@
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/testkit/test_kit.h>
+using namespace cloud::config::filedistribution;
using namespace config;
using namespace document;
using namespace proton;
@@ -23,7 +24,6 @@ using namespace search::index;
using namespace search;
using namespace vespa::config::search::core;
using namespace vespa::config::search;
-using namespace cloud::config::filedistribution;
using proton::matching::RankingConstants;
typedef DocumentDBConfigHelper DBCM;
@@ -45,12 +45,12 @@ Schema::SP
getSchema(int step)
{
Schema::SP schema(new Schema);
- schema->addIndexField(Schema::IndexField("foo1", schema::STRING));
+ schema->addIndexField(Schema::IndexField("foo1", schema::DataType::STRING));
if (step < 2) {
- schema->addIndexField(Schema::IndexField("foo2", schema::STRING));
+ schema->addIndexField(Schema::IndexField("foo2", schema::DataType::STRING));
}
if (step < 1) {
- schema->addIndexField(Schema::IndexField("foo3", schema::STRING));
+ schema->addIndexField(Schema::IndexField("foo3", schema::DataType::STRING));
}
return schema;
}
@@ -83,7 +83,7 @@ Schema
makeHistorySchema()
{
Schema hs;
- hs.addIndexField(Schema::IndexField("history", schema::STRING));
+ hs.addIndexField(Schema::IndexField("history", schema::DataType::STRING));
return hs;
}
diff --git a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
index 3b863561188..72098a94ad4 100644
--- a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
+++ b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
@@ -96,7 +96,7 @@ const uint32_t field_id = 1;
Schema getSchema() {
Schema schema;
- schema.addIndexField(Schema::IndexField(field_name, search::index::schema::STRING));
+ schema.addIndexField(Schema::IndexField(field_name, search::index::schema::DataType::STRING));
return schema;
}
diff --git a/searchcore/src/tests/proton/index/fusionrunner_test.cpp b/searchcore/src/tests/proton/index/fusionrunner_test.cpp
index 5b0420bc922..b29e742371c 100644
--- a/searchcore/src/tests/proton/index/fusionrunner_test.cpp
+++ b/searchcore/src/tests/proton/index/fusionrunner_test.cpp
@@ -27,7 +27,12 @@ LOG_SETUP("fusionrunner_test");
using document::Document;
using document::FieldValue;
+using proton::ExecutorThreadingService;
using search::FixedSourceSelector;
+using search::TuneFileAttributes;
+using search::TuneFileIndexManager;
+using search::TuneFileIndexing;
+using search::TuneFileSearch;
using search::diskindex::DiskIndex;
using search::diskindex::IndexBuilder;
using search::fef::MatchData;
@@ -35,26 +40,23 @@ using search::fef::MatchDataLayout;
using search::fef::TermFieldHandle;
using search::fef::TermFieldMatchData;
using search::index::DocBuilder;
-using search::index::Schema;
using search::index::DummyFileHeaderContext;
+using search::index::Schema;
+using search::index::schema::DataType;
using search::memoryindex::MemoryIndex;
using search::query::SimpleStringTerm;
using search::queryeval::Blueprint;
+using search::queryeval::FakeRequestContext;
using search::queryeval::FieldSpec;
using search::queryeval::FieldSpecList;
using search::queryeval::ISourceSelector;
using search::queryeval::SearchIterator;
-using search::queryeval::FakeRequestContext;
+using searchcorespi::index::FusionRunner;
+using searchcorespi::index::FusionSpec;
using std::set;
using std::string;
+
using namespace proton;
-using search::TuneFileAttributes;
-using search::TuneFileIndexing;
-using search::TuneFileIndexManager;
-using search::TuneFileSearch;
-using searchcorespi::index::FusionRunner;
-using searchcorespi::index::FusionSpec;
-using proton::ExecutorThreadingService;
namespace {
@@ -125,7 +127,7 @@ const uint32_t disk_id[] = { 1, 2, 21, 42 };
Schema getSchema() {
Schema schema;
schema.addIndexField(
- Schema::IndexField(field_name, search::index::schema::STRING));
+ Schema::IndexField(field_name, DataType::STRING));
return schema;
}
diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp
index 9d8f4d8b7f6..791e8c2619c 100644
--- a/searchcore/src/tests/proton/index/indexmanager_test.cpp
+++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp
@@ -33,29 +33,31 @@ LOG_SETUP("indexmanager_test");
using document::Document;
using document::FieldValue;
+using search::SequencedTaskExecutor;
+using search::SerialNum;
+using search::TuneFileAttributes;
+using search::TuneFileIndexManager;
+using search::TuneFileIndexing;
using search::datastore::EntryRef;
using search::index::DocBuilder;
-using search::index::Schema;
using search::index::DummyFileHeaderContext;
-using search::memoryindex::Dictionary;
+using search::index::Schema;
+using search::index::schema::DataType;
+using search::makeLambdaTask;
using search::memoryindex::CompactDocumentWordsStore;
+using search::memoryindex::Dictionary;
using search::queryeval::Source;
-using search::SequencedTaskExecutor;
-using search::SerialNum;
using std::set;
using std::string;
+using vespalib::BlockingThreadStackExecutor;
using vespalib::Gate;
using vespalib::Monitor;
using vespalib::MonitorGuard;
+using vespalib::ThreadStackExecutor;
+
using namespace proton;
using namespace searchcorespi;
using namespace searchcorespi::index;
-using search::TuneFileIndexing;
-using search::TuneFileIndexManager;
-using search::TuneFileAttributes;
-using vespalib::BlockingThreadStackExecutor;
-using vespalib::ThreadStackExecutor;
-using search::makeLambdaTask;
namespace {
@@ -78,7 +80,7 @@ const uint32_t docid = 1;
Schema getSchema() {
Schema schema;
- schema.addIndexField(Schema::IndexField(field_name, search::index::schema::STRING));
+ schema.addIndexField(Schema::IndexField(field_name, DataType::STRING));
return schema;
}
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index a1c6538baa7..d745f0dd7c9 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.cpp
@@ -47,6 +47,8 @@ using namespace search::index;
using namespace search::query;
using namespace search::queryeval;
using namespace search;
+
+using search::index::schema::DataType;
using storage::spi::Timestamp;
void inject_match_phase_limiting(Properties &setup, const vespalib::string &attribute, size_t max_hits, bool descending)
@@ -133,12 +135,12 @@ struct MyWorld {
void basicSetup(size_t heapSize=10, size_t arraySize=100) {
// schema
- schema.addIndexField(Schema::IndexField("f1", schema::STRING));
- schema.addIndexField(Schema::IndexField("f2", schema::STRING));
- schema.addIndexField(Schema::IndexField("tensor_field", schema::TENSOR));
- schema.addAttributeField(Schema::AttributeField("a1", schema::INT32));
- schema.addAttributeField(Schema::AttributeField("a2", schema::INT32));
- schema.addAttributeField(Schema::AttributeField("predicate_field", schema::BOOLEANTREE));
+ schema.addIndexField(Schema::IndexField("f1", DataType::STRING));
+ schema.addIndexField(Schema::IndexField("f2", DataType::STRING));
+ schema.addIndexField(Schema::IndexField("tensor_field", DataType::TENSOR));
+ schema.addAttributeField(Schema::AttributeField("a1", DataType::INT32));
+ schema.addAttributeField(Schema::AttributeField("a2", DataType::INT32));
+ schema.addAttributeField(Schema::AttributeField("predicate_field", DataType::BOOLEANTREE));
// config
config.add(indexproperties::rank::FirstPhase::NAME, "attribute(a1)");
diff --git a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
index 97310597e14..cd1cb1058c7 100644
--- a/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
+++ b/searchcore/src/tests/proton/reprocessing/attribute_reprocessing_initializer/attribute_reprocessing_initializer_test.cpp
@@ -24,6 +24,7 @@ using namespace search;
using namespace search::index;
using search::attribute::Config;
using search::attribute::BasicType;
+using search::index::schema::DataType;
const vespalib::string TEST_DIR = "test_output";
const SerialNum INIT_SERIAL_NUM = 10;
@@ -63,18 +64,18 @@ struct MyConfig
for (auto attr : attrs) {
if (attr == "tensor") {
_mgr->addAttribute(attr, test::AttributeUtils::getTensorConfig(), 1);
- _schema.addAttributeField(Schema::AttributeField(attr, schema::TENSOR));
+ _schema.addAttributeField(Schema::AttributeField(attr, DataType::TENSOR));
} else if (attr == "predicate") {
_mgr->addAttribute(attr, test::AttributeUtils::getPredicateConfig(), 1);
- _schema.addAttributeField(Schema::AttributeField(attr, schema::BOOLEANTREE));
+ _schema.addAttributeField(Schema::AttributeField(attr, DataType::BOOLEANTREE));
} else {
_mgr->addAttribute(attr, test::AttributeUtils::getStringConfig(), 1);
- _schema.addAttributeField(Schema::AttributeField(attr, schema::STRING));
+ _schema.addAttributeField(Schema::AttributeField(attr, DataType::STRING));
}
}
}
void addIndexField(const vespalib::string &name) {
- _schema.addIndexField(Schema::IndexField(name, schema::STRING));
+ _schema.addIndexField(Schema::IndexField(name, DataType::STRING));
}
};
diff --git a/searchcore/src/tests/proton/server/documentretriever_test.cpp b/searchcore/src/tests/proton/server/documentretriever_test.cpp
index 8f94f382870..d3a1f4d47cf 100644
--- a/searchcore/src/tests/proton/server/documentretriever_test.cpp
+++ b/searchcore/src/tests/proton/server/documentretriever_test.cpp
@@ -38,7 +38,6 @@
using document::ArrayFieldValue;
using document::FieldValue;
using document::BucketId;
-using document::DataType;
using document::Document;
using document::DocumentId;
using document::DocumentType;
@@ -68,6 +67,7 @@ using search::attribute::CollectionType;
using search::attribute::Config;
using search::attribute::IAttributeVector;
using search::index::Schema;
+using search::index::schema::DataType;
using storage::spi::Bucket;
using storage::spi::GetResult;
using storage::spi::PartitionId;
@@ -150,25 +150,25 @@ document::DocumenttypesConfig getRepoConfig() {
builder.document(doc_type_id, doc_type_name,
Struct(doc_type_name + ".header"),
Struct(doc_type_name + ".body")
- .addField(static_field, DataType::T_INT)
- .addField(dyn_field_i, DataType::T_INT)
- .addField(dyn_field_d, DataType::T_DOUBLE)
- .addField(dyn_field_s, DataType::T_STRING)
- .addField(dyn_field_n, DataType::T_FLOAT)
- .addField(dyn_field_nai, DataType::T_INT)
- .addField(dyn_field_nas, DataType::T_STRING)
- .addField(dyn_field_p, DataType::T_PREDICATE)
- .addField(dyn_arr_field_i, Array(DataType::T_INT))
- .addField(dyn_arr_field_d, Array(DataType::T_DOUBLE))
- .addField(dyn_arr_field_s, Array(DataType::T_STRING))
- .addField(dyn_arr_field_n, Array(DataType::T_FLOAT))
- .addField(dyn_wset_field_i, Wset(DataType::T_INT))
- .addField(dyn_wset_field_d, Wset(DataType::T_DOUBLE))
- .addField(dyn_wset_field_s, Wset(DataType::T_STRING))
- .addField(dyn_wset_field_n, Wset(DataType::T_FLOAT))
+ .addField(static_field, document::DataType::T_INT)
+ .addField(dyn_field_i, document::DataType::T_INT)
+ .addField(dyn_field_d, document::DataType::T_DOUBLE)
+ .addField(dyn_field_s, document::DataType::T_STRING)
+ .addField(dyn_field_n, document::DataType::T_FLOAT)
+ .addField(dyn_field_nai, document::DataType::T_INT)
+ .addField(dyn_field_nas, document::DataType::T_STRING)
+ .addField(dyn_field_p, document::DataType::T_PREDICATE)
+ .addField(dyn_arr_field_i, Array(document::DataType::T_INT))
+ .addField(dyn_arr_field_d, Array(document::DataType::T_DOUBLE))
+ .addField(dyn_arr_field_s, Array(document::DataType::T_STRING))
+ .addField(dyn_arr_field_n, Array(document::DataType::T_FLOAT))
+ .addField(dyn_wset_field_i, Wset(document::DataType::T_INT))
+ .addField(dyn_wset_field_d, Wset(document::DataType::T_DOUBLE))
+ .addField(dyn_wset_field_s, Wset(document::DataType::T_STRING))
+ .addField(dyn_wset_field_n, Wset(document::DataType::T_FLOAT))
.addField(position_field,
PositionDataType::getInstance().getId())
- .addField(zcurve_field, DataType::T_LONG));
+ .addField(zcurve_field, document::DataType::T_LONG));
return builder.config();
}
@@ -176,17 +176,17 @@ BasicType
convertDataType(Schema::DataType t)
{
switch (t) {
- case schema::INT32:
+ case DataType::INT32:
return BasicType::INT32;
- case schema::INT64:
+ case DataType::INT64:
return BasicType::INT64;
- case schema::FLOAT:
+ case DataType::FLOAT:
return BasicType::FLOAT;
- case schema::DOUBLE:
+ case DataType::DOUBLE:
return BasicType::DOUBLE;
- case schema::STRING:
+ case DataType::STRING:
return BasicType::STRING;
- case schema::BOOLEANTREE:
+ case DataType::BOOLEANTREE:
return BasicType::PREDICATE;
default:
throw std::runtime_error(make_string("Data type %u not handled", (uint32_t)t));
@@ -197,11 +197,11 @@ CollectionType
convertCollectionType(Schema::CollectionType ct)
{
switch (ct) {
- case schema::SINGLE:
+ case schema::CollectionType::SINGLE:
return CollectionType::SINGLE;
- case schema::ARRAY:
+ case schema::CollectionType::ARRAY:
return CollectionType::ARRAY;
- case schema::WEIGHTEDSET:
+ case schema::CollectionType::WEIGHTEDSET:
return CollectionType::WSET;
default:
throw std::runtime_error(make_string("Collection type %u not handled", (uint32_t)ct));
@@ -247,7 +247,7 @@ struct Fixture {
void addAttribute(const char *name, U val,
Schema::DataType t, Schema::CollectionType ct) {
T *attr = addAttribute<T>(name, t, ct);
- if (ct == schema::SINGLE) {
+ if (ct == schema::CollectionType::SINGLE) {
attr->update(lid, val);
} else {
attr->append(lid, val + 1, dyn_weight);
@@ -277,43 +277,43 @@ struct Fixture {
Result putRes(meta_store.get().put(gid, bucket_id, timestamp, docSize, inspect.getLid()));
lid = putRes.getLid();
ASSERT_TRUE(putRes.ok());
- schema::CollectionType ct = schema::SINGLE;
+ schema::CollectionType ct = schema::CollectionType::SINGLE;
addAttribute<IntegerAttribute>(
- dyn_field_i, dyn_value_i, schema::INT32, ct);
+ dyn_field_i, dyn_value_i, DataType::INT32, ct);
addAttribute<FloatingPointAttribute>(
- dyn_field_d, dyn_value_d, schema::DOUBLE, ct);
+ dyn_field_d, dyn_value_d, DataType::DOUBLE, ct);
addAttribute<StringAttribute>(
- dyn_field_s, dyn_value_s, schema::STRING, ct);
+ dyn_field_s, dyn_value_s, DataType::STRING, ct);
addAttribute<FloatingPointAttribute>(
- dyn_field_n, schema::FLOAT, ct);
+ dyn_field_n, DataType::FLOAT, ct);
addAttribute<IntegerAttribute>(
- dyn_field_nai, schema::INT32, ct);
+ dyn_field_nai, DataType::INT32, ct);
addAttribute<StringAttribute>(
- dyn_field_nas, schema::STRING, ct);
+ dyn_field_nas, DataType::STRING, ct);
addAttribute<IntegerAttribute>(
- zcurve_field, dynamic_zcurve_value, schema::INT64, ct);
+ zcurve_field, dynamic_zcurve_value, DataType::INT64, ct);
PredicateAttribute *attr = addAttribute<PredicateAttribute>(
- dyn_field_p, schema::BOOLEANTREE, ct);
+ dyn_field_p, DataType::BOOLEANTREE, ct);
attr->getIndex().indexEmptyDocument(lid);
attr->commit();
- ct = schema::ARRAY;
+ ct = schema::CollectionType::ARRAY;
addAttribute<IntegerAttribute>(
- dyn_arr_field_i, dyn_value_i, schema::INT32, ct);
+ dyn_arr_field_i, dyn_value_i, DataType::INT32, ct);
addAttribute<FloatingPointAttribute>(
- dyn_arr_field_d, dyn_value_d, schema::DOUBLE, ct);
+ dyn_arr_field_d, dyn_value_d, DataType::DOUBLE, ct);
addAttribute<StringAttribute>(
- dyn_arr_field_s, dyn_value_s, schema::STRING, ct);
+ dyn_arr_field_s, dyn_value_s, DataType::STRING, ct);
addAttribute<FloatingPointAttribute>(
- dyn_arr_field_n, schema::FLOAT, ct);
- ct = schema::WEIGHTEDSET;
+ dyn_arr_field_n, DataType::FLOAT, ct);
+ ct = schema::CollectionType::WEIGHTEDSET;
addAttribute<IntegerAttribute>(
- dyn_wset_field_i, dyn_value_i, schema::INT32, ct);
+ dyn_wset_field_i, dyn_value_i, DataType::INT32, ct);
addAttribute<FloatingPointAttribute>(
- dyn_wset_field_d, dyn_value_d, schema::DOUBLE, ct);
+ dyn_wset_field_d, dyn_value_d, DataType::DOUBLE, ct);
addAttribute<StringAttribute>(
- dyn_wset_field_s, dyn_value_s, schema::STRING, ct);
+ dyn_wset_field_s, dyn_value_s, DataType::STRING, ct);
addAttribute<FloatingPointAttribute>(
- dyn_wset_field_n, schema::FLOAT, ct);
+ dyn_wset_field_n, DataType::FLOAT, ct);
}
};
@@ -407,7 +407,7 @@ TEST_F("require that attributes are patched into stored document", Fixture) {
}
TEST_F("require that attributes are patched into stored document unless also index field", Fixture) {
- f.schema.addIndexField(Schema::IndexField(dyn_field_s, schema::STRING));
+ f.schema.addIndexField(Schema::IndexField(dyn_field_s, DataType::STRING));
DocumentMetaData meta_data = f.retriever.getDocumentMetaData(doc_id);
Document::UP doc = f.retriever.getDocument(meta_data.lid);
ASSERT_TRUE(doc.get());
diff --git a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
index 387fff27ca9..8b21ed40fc8 100644
--- a/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
+++ b/searchcore/src/tests/proton/server/memoryconfigstore_test.cpp
@@ -11,8 +11,10 @@ LOG_SETUP("memoryconfigstore_test");
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchcore/proton/common/schemautil.h>
-using search::index::Schema;
using search::SerialNum;
+using search::index::Schema;
+using search::index::schema::DataType;
+
using namespace proton;
namespace {
@@ -35,12 +37,12 @@ Schema::SP
getSchema(int step)
{
Schema::SP schema(new Schema);
- schema->addIndexField(Schema::IndexField("foo1", search::index::schema::STRING));
+ schema->addIndexField(Schema::IndexField("foo1", DataType::STRING));
if (step < 2) {
- schema->addIndexField(Schema::IndexField("foo2", search::index::schema::STRING));
+ schema->addIndexField(Schema::IndexField("foo2", DataType::STRING));
}
if (step < 1) {
- schema->addIndexField(Schema::IndexField("foo3", search::index::schema::STRING));
+ schema->addIndexField(Schema::IndexField("foo3", DataType::STRING));
}
return schema;
}
@@ -113,7 +115,7 @@ TEST("require that wipe history clears previous history schema "
"and adds new, identical entry for current serial num") {
MemoryConfigStore config_store;
Schema::SP history(new Schema);
- history->addIndexField(Schema::IndexField("foo", search::index::schema::STRING));
+ history->addIndexField(Schema::IndexField("foo", DataType::STRING));
config_store.saveConfig(*getConfig(10), *history, 5);
DocumentDBConfig::SP config;
config_store.loadConfig(*getConfig(14), 5, config, history);
@@ -171,7 +173,7 @@ TEST("require that wipe history clears only portions of history")
TEST("require that wipe history does nothing if serial num exists") {
MemoryConfigStore config_store;
Schema::SP history(new Schema);
- history->addIndexField(Schema::IndexField("foo", search::index::schema::STRING));
+ history->addIndexField(Schema::IndexField("foo", DataType::STRING));
config_store.saveConfig(*getConfig(10), *history, 5);
DocumentDBConfig::SP config;
config_store.saveWipeHistoryConfig(5, 0);
diff --git a/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp b/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp
index fcbf4e3c241..2c5e119ecbe 100644
--- a/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp
+++ b/searchcore/src/tests/proton/verify_ranksetup/verify_ranksetup_test.cpp
@@ -18,6 +18,9 @@ const char *invalid_feature = "invalid_feature_name and format";
using namespace search::fef::indexproperties;
using namespace search::index;
+using search::index::schema::CollectionType;
+using search::index::schema::DataType;
+
struct Writer {
FILE *file;
Writer(const std::string &file_name) {
@@ -185,10 +188,10 @@ struct EmptyModel : Model {};
struct SimpleModel : Model {
SimpleModel() : Model() {
- index("title", schema::STRING, schema::SINGLE);
- index("list", schema::STRING, schema::ARRAY);
- index("keywords", schema::STRING, schema::WEIGHTEDSET);
- attribute("date", schema::INT32, schema::SINGLE);
+ index("title", DataType::STRING, CollectionType::SINGLE);
+ index("list", DataType::STRING, CollectionType::ARRAY);
+ index("keywords", DataType::STRING, CollectionType::WEIGHTEDSET);
+ attribute("date", DataType::INT32, CollectionType::SINGLE);
imported_attribute("imported_attr");
constants["my_tensor"] = "tensor(x{},y{})";
}
@@ -196,8 +199,8 @@ struct SimpleModel : Model {
struct ShadowModel : Model {
ShadowModel() : Model() {
- index("both", schema::STRING, schema::SINGLE);
- attribute("both", schema::STRING, schema::SINGLE);
+ index("both", DataType::STRING, CollectionType::SINGLE);
+ attribute("both", DataType::STRING, CollectionType::SINGLE);
}
};