From 242eb321d0649859ac427d403b21f1bf83e5a7be Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Sat, 24 Mar 2018 11:25:16 +0100 Subject: Rewrite test to new test syntax --- .../searchable/attributeblueprint_test.cpp | 86 +++++++--------------- 1 file changed, 25 insertions(+), 61 deletions(-) (limited to 'searchlib/src') diff --git a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp index db6df2d1140..6753153c224 100644 --- a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp @@ -43,34 +43,6 @@ using namespace search; namespace { -class Test : public vespalib::TestApp { - void requireThatIteratorsCanBeCreated(); - void requireThatRangeTermsWorkToo(); - void requireThatPrefixTermsWork(); - void requireThatLocationTermsWork(); - void requireThatFastSearchLocationTermsWork(); - - bool search(const string &term, IAttributeManager &attribute_manager); - bool search(const Node &term, IAttributeManager &attribute_manager); - -public: - int Main() override; -}; - -int -Test::Main() -{ - TEST_INIT("attributeblueprint_test"); - - TEST_DO(requireThatIteratorsCanBeCreated()); - TEST_DO(requireThatRangeTermsWorkToo()); - TEST_DO(requireThatPrefixTermsWork()); - TEST_DO(requireThatLocationTermsWork()); - TEST_DO(requireThatFastSearchLocationTermsWork()); - - TEST_DONE(); -} - const string field = "field"; const int32_t weight = 1; @@ -105,16 +77,9 @@ public: } }; -bool Test::search(const string &term, IAttributeManager &attribute_manager) { - TEST_STATE(term.c_str()); - SimpleStringTerm node(term, "field", 0, Weight(0)); - bool ret = search(node, attribute_manager); - return ret; -} - constexpr uint32_t DOCID_LIMIT = 3; -bool Test::search(const Node &node, IAttributeManager &attribute_manager) { +bool search(const Node &node, IAttributeManager &attribute_manager) { AttributeContext ac(attribute_manager); FakeRequestContext requestContext(&ac); MatchData::UP md(MatchData::makeTestInstance(1, 1)); @@ -132,6 +97,13 @@ bool Test::search(const Node &node, IAttributeManager &attribute_manager) { return iterator->seek(2); } +bool search(const string &term, IAttributeManager &attribute_manager) { + TEST_STATE(term.c_str()); + SimpleStringTerm node(term, "field", 0, Weight(0)); + bool ret = search(node, attribute_manager); + return ret; +} + template struct AttributeVectorTypeFinder { typedef SingleStringExtAttribute Type; static void add(Type & a, const T & v) { a.add(v, weight); } @@ -173,13 +145,15 @@ MyAttributeManager makeFastSearchLongAttribute(int64_t value) { return fill(attr, value); } -void Test::requireThatIteratorsCanBeCreated() { +} // namespace + +TEST("requireThatIteratorsCanBeCreated") { MyAttributeManager attribute_manager = makeAttributeManager("foo"); EXPECT_TRUE(search("foo", attribute_manager)); } -void Test::requireThatRangeTermsWorkToo() { +TEST("requireThatRangeTermsWorkToo") { MyAttributeManager attribute_manager = makeAttributeManager(int64_t(42)); EXPECT_TRUE(search("[23;46]", attribute_manager)); @@ -188,7 +162,7 @@ void Test::requireThatRangeTermsWorkToo() { EXPECT_TRUE(search("[10;]", attribute_manager)); } -void Test::requireThatPrefixTermsWork() +TEST("requireThatPrefixTermsWork") { MyAttributeManager attribute_manager = makeAttributeManager("foo"); @@ -196,44 +170,34 @@ void Test::requireThatPrefixTermsWork() EXPECT_TRUE(search(node, attribute_manager)); } -void Test::requireThatLocationTermsWork() { +TEST("requireThatLocationTermsWork") { // 0xcc is z-curve for (10, 10). MyAttributeManager attribute_manager = makeAttributeManager(int64_t(0xcc)); - SimpleLocationTerm node(Location(Point(10, 10), 3, 0), - field, 0, Weight(0)); + SimpleLocationTerm node(Location(Point(10, 10), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(100, 100), 3, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(100, 100), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(!search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(13, 13), 4, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(13, 13), 4, 0), field, 0, Weight(0)); EXPECT_TRUE(!search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(10, 13), 3, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(10, 13), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(search(node, attribute_manager)); } -void Test::requireThatFastSearchLocationTermsWork() { +TEST("requireThatFastSearchLocationTermsWork") { // 0xcc is z-curve for (10, 10). MyAttributeManager attribute_manager = makeFastSearchLongAttribute(int64_t(0xcc)); - SimpleLocationTerm node(Location(Point(10, 10), 3, 0), - field, 0, Weight(0)); + SimpleLocationTerm node(Location(Point(10, 10), 3, 0), field, 0, Weight(0)); #if 0 EXPECT_TRUE(search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(100, 100), 3, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(100, 100), 3, 0),field, 0, Weight(0)); EXPECT_TRUE(!search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(13, 13), 4, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(13, 13), 4, 0),field, 0, Weight(0)); EXPECT_TRUE(!search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(10, 13), 3, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(10, 13), 3, 0),field, 0, Weight(0)); EXPECT_TRUE(search(node, attribute_manager)); #endif } - -} // namespace - -TEST_APPHOOK(Test); + +TEST_MAIN() { TEST_RUN_ALL(); } -- cgit v1.2.3 From 3aac7bad02036393444a9fedd930be9f08c65a8a Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Sat, 24 Mar 2018 11:38:52 +0100 Subject: Cleanup formatting. --- .../attribute_searchable_adapter_test.cpp | 50 ++++++++-------------- 1 file changed, 18 insertions(+), 32 deletions(-) (limited to 'searchlib/src') diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp index a6e06af1b71..89f6bb5d88e 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp @@ -64,6 +64,7 @@ using search::queryeval::PostingInfo; using search::queryeval::SearchIterator; using std::vector; using vespalib::string; +using vespalib::make_string; using namespace search::attribute; using namespace search; @@ -318,17 +319,13 @@ TEST("requireThatLocationTermsWork") { // 0xcc is z-curve for (10, 10). MyAttributeManager attribute_manager = makeAttributeManager(int64_t(0xcc)); - SimpleLocationTerm node(Location(Point(10, 10), 3, 0), - field, 0, Weight(0)); + SimpleLocationTerm node(Location(Point(10, 10), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(100, 100), 3, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(100, 100), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(!search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(13, 13), 4, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(13, 13), 4, 0), field, 0, Weight(0)); EXPECT_TRUE(!search(node, attribute_manager)); - node = SimpleLocationTerm(Location(Point(10, 13), 3, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(10, 13), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(search(node, attribute_manager)); } @@ -336,17 +333,13 @@ TEST("requireThatOptimizedLocationTermsWork") { // 0xcc is z-curve for (10, 10). MyAttributeManager attribute_manager = makeFastSearchLongAttributeManager(int64_t(0xcc)); - SimpleLocationTerm node(Location(Point(10, 10), 3, 0), - field, 0, Weight(0)); + SimpleLocationTerm node(Location(Point(10, 10), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(search(node, attribute_manager, true)); - node = SimpleLocationTerm(Location(Point(100, 100), 3, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(100, 100), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(!search(node, attribute_manager, true)); - node = SimpleLocationTerm(Location(Point(13, 13), 4, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(13, 13), 4, 0), field, 0, Weight(0)); EXPECT_TRUE(!search(node, attribute_manager, true)); - node = SimpleLocationTerm(Location(Point(10, 13), 3, 0), - field, 0, Weight(0)); + node = SimpleLocationTerm(Location(Point(10, 13), 3, 0), field, 0, Weight(0)); EXPECT_TRUE(search(node, attribute_manager, true)); } @@ -368,7 +361,7 @@ TEST("require that optimized location search works with wrapped bounding box (no } void set_weights(StringAttribute *attr, uint32_t docid, - int32_t foo_weight, int32_t bar_weight, int32_t baz_weight) + int32_t foo_weight, int32_t bar_weight, int32_t baz_weight) { attr->clearDoc(docid); if (foo_weight > 0) attr->append(docid, "foo", foo_weight); @@ -456,13 +449,11 @@ TEST("require that direct attribute iterators work") { EXPECT_TRUE(result.has_minmax); EXPECT_EQUAL(100, result.min_weight); EXPECT_EQUAL(1000, result.max_weight); - EXPECT_TRUE(result.iterator_dump.find("DocumentWeightSearchIterator") - != vespalib::string::npos); + EXPECT_TRUE(result.iterator_dump.find("DocumentWeightSearchIterator") != vespalib::string::npos); } else { EXPECT_EQUAL(num_docs, result.est_hits); EXPECT_FALSE(result.has_minmax); - EXPECT_TRUE(result.iterator_dump.find("DocumentWeightSearchIterator") - == vespalib::string::npos); + EXPECT_TRUE(result.iterator_dump.find("DocumentWeightSearchIterator") == vespalib::string::npos); } ASSERT_EQUAL(3u, result.hits.size()); EXPECT_FALSE(result.est_empty); @@ -551,10 +542,7 @@ TEST("require that predicate query in non-predicate field yields empty.") { } TEST("require that predicate query in predicate field yields results.") { - PredicateAttribute *attr = - new PredicateAttribute( - field, Config(BasicType::PREDICATE, - CollectionType::SINGLE)); + PredicateAttribute *attr = new PredicateAttribute(field, Config(BasicType::PREDICATE, CollectionType::SINGLE)); add_docs(attr, num_docs); attr->getIndex().indexEmptyDocument(2); // matches anything attr->getIndex().commit(); @@ -611,10 +599,8 @@ void set_attr_value(AttributeVector &attr, uint32_t docid, size_t value) { } } -MyAttributeManager make_diversity_setup(BasicType::Type field_type, - bool field_fast_search, - BasicType::Type other_type, - bool other_fast_search) +MyAttributeManager make_diversity_setup(BasicType::Type field_type, bool field_fast_search, + BasicType::Type other_type, bool other_fast_search) { Config field_cfg(field_type, CollectionType::SINGLE); field_cfg.setFastSearch(field_fast_search); @@ -663,9 +649,9 @@ TEST("require that diversity range searches work for various types") { for (bool other_fast_search: std::vector({true, false})) { MyAttributeManager manager = make_diversity_setup(field_type, true, other_type, other_fast_search); for (bool strict: std::vector({true, false})) { - TEST_STATE(vespalib::make_string("field_type: %s, other_type: %s, other_fast_search: %s, strict: %s", - BasicType(field_type).asString(), BasicType(other_type).asString(), - other_fast_search ? "true" : "false", strict ? "true" : "false").c_str()); + TEST_STATE(make_string("field_type: %s, other_type: %s, other_fast_search: %s, strict: %s", + BasicType(field_type).asString(), BasicType(other_type).asString(), + other_fast_search ? "true" : "false", strict ? "true" : "false").c_str()); EXPECT_EQUAL(999u, diversity_hits(manager, "[;;1000;other;10]", strict)); EXPECT_EQUAL(999u, diversity_hits(manager, "[;;-1000;other;10]", strict)); EXPECT_EQUAL(100u, diversity_hits(manager, "[;;1000;other;1]", strict)); -- cgit v1.2.3 From 9e70b2520ace7245a949553f9f92646db910b804 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 3 Apr 2018 13:52:54 +0200 Subject: Add test to prove that the filter aspect is correctly handled also for the DirectAttributeBlueprint --- .../attribute_searchable_adapter_test.cpp | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'searchlib/src') diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp index 89f6bb5d88e..d8e295cb469 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp @@ -370,9 +370,10 @@ void set_weights(StringAttribute *attr, uint32_t docid, attr->commit(); } -MyAttributeManager make_weighted_string_attribute_manager(bool fast_search) { +MyAttributeManager make_weighted_string_attribute_manager(bool fast_search, bool isFilter = false) { Config cfg(BasicType::STRING, CollectionType::WSET); cfg.setFastSearch(fast_search); + cfg.setIsFilter(isFilter); AttributeVector::SP attr_ptr = AttributeFactory::createAttribute(field, cfg); StringAttribute *attr = static_cast(attr_ptr.get()); add_docs(attr, num_docs); @@ -463,6 +464,26 @@ TEST("require that direct attribute iterators work") { } } +TEST("require that single weighted set turns filter on filter fields") { + bool fast_search = true; + bool strict = true; + bool isFilter = true; + MyAttributeManager attribute_manager = make_weighted_string_attribute_manager(fast_search, isFilter); + SimpleStringTerm empty_node("notfoo", "", 0, Weight(1)); + Result empty_result = do_search(attribute_manager, empty_node, strict); + EXPECT_EQUAL(0u, empty_result.hits.size()); + SimpleStringTerm node("foo", "", 0, Weight(1)); + Result result = do_search(attribute_manager, node, strict); + EXPECT_EQUAL(3u, result.est_hits); + EXPECT_TRUE(result.iterator_dump.find("DocumentWeightSearchIterator") == vespalib::string::npos); + EXPECT_TRUE(result.iterator_dump.find("FilterAttributePostingListIteratorT") == vespalib::string::npos); + ASSERT_EQUAL(3u, result.hits.size()); + EXPECT_FALSE(result.est_empty); + EXPECT_EQUAL(20u, result.hits[0].docid); + EXPECT_EQUAL(40u, result.hits[1].docid); + EXPECT_EQUAL(50u, result.hits[2].docid); +} + const char *as_str(bool flag) { return flag? "true" : "false"; } TEST("require that attribute parallel wand works") { -- cgit v1.2.3 From 39a40b07cef9e73a46b4c1f00f4f213478faca57 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 3 Apr 2018 14:08:01 +0200 Subject: Nested namespace and default destructors --- .../src/vespa/searchcommon/common/datatype.cpp | 6 +--- .../src/vespa/searchcommon/common/datatype.h | 6 +--- .../src/vespa/searchcommon/common/schema.h | 10 ++----- .../searchcore/proton/matching/blueprintbuilder.h | 6 ++-- .../proton/matching/matchdatareservevisitor.h | 6 ++-- .../src/vespa/searchcore/proton/matching/query.cpp | 6 ++-- .../searchcore/proton/matching/querynodes.cpp | 6 ++-- .../vespa/searchcore/proton/matching/querynodes.h | 7 ++--- .../proton/matching/resolveviewvisitor.h | 6 ++-- .../searchcore/proton/matching/termdataextractor.h | 13 +++----- .../searchcore/proton/matching/viewresolver.cpp | 6 ++-- .../searchcore/proton/matching/viewresolver.h | 11 ++----- .../src/vespa/searchlib/fef/iindexenvironment.h | 14 ++------- searchlib/src/vespa/searchlib/query/tree/node.h | 6 ++-- .../queryeval/create_blueprint_visitor_helper.cpp | 6 ++-- .../queryeval/create_blueprint_visitor_helper.h | 6 ++-- .../searchlib/queryeval/dot_product_blueprint.cpp | 9 ++---- .../searchlib/queryeval/dot_product_blueprint.h | 8 ++--- .../searchlib/queryeval/dot_product_search.cpp | 6 ++-- .../vespa/searchlib/queryeval/dot_product_search.h | 12 ++------ .../searchlib/queryeval/get_weight_from_node.cpp | 6 ++-- .../searchlib/queryeval/get_weight_from_node.h | 8 ++--- .../queryeval/intermediate_blueprints.cpp | 6 ++-- .../searchlib/queryeval/intermediate_blueprints.h | 7 ++--- .../vespa/searchlib/queryeval/irequestcontext.h | 11 ++----- .../vespa/searchlib/queryeval/iterator_pack.cpp | 6 +--- .../src/vespa/searchlib/queryeval/iterator_pack.h | 9 ++---- .../vespa/searchlib/queryeval/leaf_blueprints.cpp | 35 +++++++--------------- .../vespa/searchlib/queryeval/leaf_blueprints.h | 12 +++----- .../src/vespa/searchlib/queryeval/searchable.cpp | 6 ++-- .../src/vespa/searchlib/queryeval/searchable.h | 9 ++---- .../src/vespa/searchlib/queryeval/searchiterator.h | 11 +++---- .../searchlib/queryeval/simple_phrase_blueprint.h | 8 ++--- .../src/vespa/searchlib/queryeval/split_float.cpp | 6 ++-- .../src/vespa/searchlib/queryeval/split_float.h | 6 ++-- .../src/vespa/searchlib/queryeval/termasstring.cpp | 6 ++-- .../src/vespa/searchlib/queryeval/termasstring.h | 9 ++---- .../queryeval/weighted_set_term_blueprint.h | 11 +++---- 38 files changed, 101 insertions(+), 227 deletions(-) (limited to 'searchlib/src') diff --git a/searchcommon/src/vespa/searchcommon/common/datatype.cpp b/searchcommon/src/vespa/searchcommon/common/datatype.cpp index 12192bb1bec..81e6b8a1f34 100644 --- a/searchcommon/src/vespa/searchcommon/common/datatype.cpp +++ b/searchcommon/src/vespa/searchcommon/common/datatype.cpp @@ -5,9 +5,7 @@ #include #include -namespace search { -namespace index { -namespace schema { +namespace search::index::schema { using config::InvalidConfigException; @@ -99,5 +97,3 @@ operator<<(std::ostream &os, const CollectionType &type) } } -} -} diff --git a/searchcommon/src/vespa/searchcommon/common/datatype.h b/searchcommon/src/vespa/searchcommon/common/datatype.h index 7ba21e0496c..ad762b9acc4 100644 --- a/searchcommon/src/vespa/searchcommon/common/datatype.h +++ b/searchcommon/src/vespa/searchcommon/common/datatype.h @@ -4,9 +4,7 @@ #include -namespace search { -namespace index { -namespace schema { +namespace search::index::schema { /** * Basic data type for a field. @@ -46,5 +44,3 @@ std::ostream &operator<<(std::ostream &os, const CollectionType &type); } -} -} diff --git a/searchcommon/src/vespa/searchcommon/common/schema.h b/searchcommon/src/vespa/searchcommon/common/schema.h index 7606b36a777..374ea840f5c 100644 --- a/searchcommon/src/vespa/searchcommon/common/schema.h +++ b/searchcommon/src/vespa/searchcommon/common/schema.h @@ -8,11 +8,8 @@ #include #include -namespace vespalib { - class asciistream; -} -namespace search { -namespace index { +namespace vespalib { class asciistream; } +namespace search::index { /** * Schema class used to give a high-level description of the content @@ -419,5 +416,4 @@ public: bool empty() const; }; -} // namespace search::index -} // namespace search +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.h b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.h index 93439d97fc1..eb45a735780 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.h +++ b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.h @@ -6,8 +6,7 @@ #include #include -namespace proton { -namespace matching { +namespace proton::matching { struct BlueprintBuilder { /** @@ -20,6 +19,5 @@ struct BlueprintBuilder { ISearchContext &context); }; -} // namespace matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/matchdatareservevisitor.h b/searchcore/src/vespa/searchcore/proton/matching/matchdatareservevisitor.h index dcd95b9e473..ebe4e9b2ad7 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matchdatareservevisitor.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matchdatareservevisitor.h @@ -6,8 +6,7 @@ #include #include -namespace proton { -namespace matching { +namespace proton::matching { /** * Visits all terms of a node tree, and allocates MatchData space for @@ -34,6 +33,5 @@ public: MatchDataReserveVisitor(search::fef::MatchDataLayout &mdl) : _mdl(mdl) {} }; -} // namespace matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp index e6408e89896..33118016d92 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp @@ -33,8 +33,7 @@ using search::queryeval::SearchIterator; using vespalib::string; using std::vector; -namespace proton { -namespace matching { +namespace proton::matching { namespace { void AddLocationNode(const string &location_str, Node::UP &query_tree, Location &fef_location) { @@ -168,5 +167,4 @@ Query::createSearch(MatchData &md) const return _blueprint->createSearch(md, true); } -} // namespace matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp b/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp index 18fce357cb0..63302424db6 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp @@ -25,8 +25,7 @@ using std::map; using std::vector; using vespalib::string; -namespace proton { -namespace matching { +namespace proton::matching { ProtonTermData::ProtonTermData() = default; ProtonTermData::ProtonTermData(const ProtonTermData &) = default; @@ -124,5 +123,4 @@ ProtonTermData::FieldEntry::getHandle() const } -} // namespace matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h index 0729c9b37e9..ca6c8c75310 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h @@ -16,8 +16,7 @@ #include #include -namespace proton { -namespace matching { +namespace proton::matching { class ViewResolver; @@ -157,6 +156,4 @@ struct ProtonNodeTypes { typedef ProtonRegExpTerm RegExpTerm; }; -} // namespace matching -} // namespace proton - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h b/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h index 7f533ea1a8b..ee6fd470d89 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h +++ b/searchcore/src/vespa/searchcore/proton/matching/resolveviewvisitor.h @@ -7,8 +7,7 @@ #include #include -namespace proton { -namespace matching { +namespace proton::matching { class ResolveViewVisitor : public search::query::TemplateTermVisitor -namespace search { -namespace query { class Node; } -namespace fef { class ITermData; } -} // namespace search +namespace search::query { class Node; } +namespace search::fef { class ITermData; } -namespace proton { -namespace matching { +namespace proton::matching { struct TermDataExtractor { /** @@ -21,6 +18,4 @@ struct TermDataExtractor { std::vector &td); }; -} // namespace matching -} // namespace proton - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/viewresolver.cpp b/searchcore/src/vespa/searchcore/proton/matching/viewresolver.cpp index 84210508960..b1442fe5e92 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/viewresolver.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/viewresolver.cpp @@ -3,8 +3,7 @@ #include "viewresolver.h" #include -namespace proton { -namespace matching { +namespace proton::matching { ViewResolver & ViewResolver::add(const vespalib::stringref &view, @@ -43,5 +42,4 @@ ViewResolver::createFromSchema(const search::index::Schema &schema) return resolver; } -} // namespace matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/viewresolver.h b/searchcore/src/vespa/searchcore/proton/matching/viewresolver.h index d7a7f002e1c..124ebc67d52 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/viewresolver.h +++ b/searchcore/src/vespa/searchcore/proton/matching/viewresolver.h @@ -6,12 +6,9 @@ #include #include -namespace search { -namespace index { class Schema; } -} // namespace search +namespace search::index { class Schema; } -namespace proton { -namespace matching { +namespace proton::matching { /** * A small utility class used to resolve views into fields when @@ -66,6 +63,4 @@ public: static ViewResolver createFromSchema(const search::index::Schema &schema); }; -} // namespace matching -} // namespace proton - +} diff --git a/searchlib/src/vespa/searchlib/fef/iindexenvironment.h b/searchlib/src/vespa/searchlib/fef/iindexenvironment.h index 470f5d3491b..b35d8972300 100644 --- a/searchlib/src/vespa/searchlib/fef/iindexenvironment.h +++ b/searchlib/src/vespa/searchlib/fef/iindexenvironment.h @@ -4,16 +4,9 @@ #include -namespace vespalib { -namespace eval { +namespace vespalib::eval { class ConstantValue; } -class ConstantValue; - -} -} - -namespace search { -namespace fef { +namespace search::fef { class Properties; class FieldInfo; @@ -133,6 +126,5 @@ public: virtual ~IIndexEnvironment() {} }; -} // namespace fef -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/query/tree/node.h b/searchlib/src/vespa/searchlib/query/tree/node.h index 7f7614cac81..fe6f1b4b3b0 100644 --- a/searchlib/src/vespa/searchlib/query/tree/node.h +++ b/searchlib/src/vespa/searchlib/query/tree/node.h @@ -3,8 +3,7 @@ #include -namespace search { -namespace query { +namespace search::query { class QueryVisitor; @@ -21,6 +20,5 @@ class Node { virtual void accept(QueryVisitor &visitor) = 0; }; -} // namespace query -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp b/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp index 05784149b59..8e6429aaa90 100644 --- a/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.cpp @@ -10,8 +10,7 @@ #include "weighted_set_term_blueprint.h" #include "split_float.h" -namespace search { -namespace queryeval { +namespace search::queryeval { CreateBlueprintVisitorHelper::CreateBlueprintVisitorHelper(Searchable &searchable, const FieldSpec &field, const IRequestContext & requestContext) : _requestContext(requestContext), @@ -99,5 +98,4 @@ CreateBlueprintVisitorHelper::visitWandTerm(search::query::WandTerm &n) { createWeightedSet(bp, n); } -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.h b/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.h index 0734d7fe0d6..cded9c103dc 100644 --- a/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.h +++ b/searchlib/src/vespa/searchlib/queryeval/create_blueprint_visitor_helper.h @@ -10,8 +10,7 @@ #include #include -namespace search { -namespace queryeval { +namespace search::queryeval { class CreateBlueprintVisitorHelper : public search::query::QueryVisitor { @@ -76,5 +75,4 @@ public: void visit(search::query::RegExpTerm &n) override = 0; }; -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp index 416ff9dce9d..f76cd0d6acc 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp @@ -2,13 +2,9 @@ #include "dot_product_blueprint.h" #include "dot_product_search.h" -#include -#include #include -#include -namespace search { -namespace queryeval { +namespace search::queryeval { DotProductBlueprint::DotProductBlueprint(const FieldSpec &field) : ComplexLeafBlueprint(field), @@ -84,5 +80,4 @@ DotProductBlueprint::visitMembers(vespalib::ObjectVisitor &visitor) const visit(visitor, "_terms", _terms); } -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h index 80599f771d0..e19a6cdb7f9 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h @@ -5,10 +5,9 @@ #include "searchable.h" #include -namespace search { -namespace fef { class TermFieldMatchData; } +namespace search::fef { class TermFieldMatchData; } -namespace queryeval { +namespace search::queryeval { class DotProductBlueprint : public ComplexLeafBlueprint { @@ -38,5 +37,4 @@ public: void fetchPostings(bool strict) override; }; -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp index 34e00f8d3a8..5dba818c7a6 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp @@ -9,8 +9,7 @@ using search::fef::TermFieldMatchData; using search::fef::MatchData; using vespalib::ObjectVisitor; -namespace search { -namespace queryeval { +namespace search::queryeval { template @@ -182,5 +181,4 @@ DotProductSearch::create(TermFieldMatchData &tmd, //----------------------------------------------------------------------------- -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h index 65c12e00af3..0fa047bb215 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h @@ -7,15 +7,10 @@ #include #include #include -#include -#include -namespace search { -namespace fef { -class TermFieldMatchData; -} // namespace fef +namespace search::fef { class TermFieldMatchData; } -namespace queryeval { +namespace search::queryeval { /** * Search iterator for a sparse dot product, based on a set of child @@ -41,6 +36,5 @@ public: std::vector &&iterators); }; -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/get_weight_from_node.cpp b/searchlib/src/vespa/searchlib/queryeval/get_weight_from_node.cpp index cfa0f2fefcf..8fa6af74ae2 100644 --- a/searchlib/src/vespa/searchlib/queryeval/get_weight_from_node.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/get_weight_from_node.cpp @@ -10,8 +10,7 @@ using search::query::SimpleQueryNodeTypes; using search::query::TemplateTermVisitor; using search::query::Weight; -namespace search { -namespace queryeval { +namespace search::queryeval { namespace { struct WeightExtractor : public TemplateTermVisitor -namespace search { -namespace query { class Node; } -namespace queryeval { +namespace search::query { class Node; } +namespace search::queryeval { search::query::Weight getWeightFromNode(const search::query::Node &node); -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp index 65eb7127692..9bc9d3161e6 100644 --- a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp @@ -12,8 +12,7 @@ #include "isourceselector.h" #include -namespace search { -namespace queryeval { +namespace search::queryeval { //----------------------------------------------------------------------------- @@ -581,5 +580,4 @@ SourceBlenderBlueprint::isCompatibleWith(const SourceBlenderBlueprint &other) co //----------------------------------------------------------------------------- -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h index 7c847545814..440794c25d8 100644 --- a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h +++ b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h @@ -3,11 +3,9 @@ #pragma once #include "blueprint.h" -#include "searchable.h" -#include +#include "multisearch.h" -namespace search { -namespace queryeval { +namespace search::queryeval { class ISourceSelector; @@ -175,4 +173,3 @@ public: }; } -} diff --git a/searchlib/src/vespa/searchlib/queryeval/irequestcontext.h b/searchlib/src/vespa/searchlib/queryeval/irequestcontext.h index 2809f0767fb..b779ac400bf 100644 --- a/searchlib/src/vespa/searchlib/queryeval/irequestcontext.h +++ b/searchlib/src/vespa/searchlib/queryeval/irequestcontext.h @@ -5,13 +5,9 @@ #include #include -namespace search { +namespace search::attribute { class IAttributeVector; } -namespace attribute { -class IAttributeVector; -} - -namespace queryeval { +namespace search::queryeval { /** * Provides a context that follows the life of a query. @@ -35,5 +31,4 @@ public: virtual const attribute::IAttributeVector *getAttributeStableEnum(const vespalib::string &name) const = 0; }; -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/iterator_pack.cpp b/searchlib/src/vespa/searchlib/queryeval/iterator_pack.cpp index 1f5858c1100..b11f85e09f9 100644 --- a/searchlib/src/vespa/searchlib/queryeval/iterator_pack.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/iterator_pack.cpp @@ -2,11 +2,9 @@ #include "iterator_pack.h" #include "termwise_helper.h" -#include #include -namespace search { -namespace queryeval { +namespace search::queryeval { SearchIteratorPack::~SearchIteratorPack() { } @@ -61,5 +59,3 @@ SearchIteratorPack::or_hits_into(BitVector &result, uint32_t begin_id) const { } -} // namespace search - diff --git a/searchlib/src/vespa/searchlib/queryeval/iterator_pack.h b/searchlib/src/vespa/searchlib/queryeval/iterator_pack.h index 58c774e0903..d35c1749f40 100644 --- a/searchlib/src/vespa/searchlib/queryeval/iterator_pack.h +++ b/searchlib/src/vespa/searchlib/queryeval/iterator_pack.h @@ -5,11 +5,9 @@ #include "searchiterator.h" #include -namespace search { +namespace search::fef { class MatchData; } -namespace fef { class MatchData; } - -namespace queryeval { +namespace search::queryeval { class SearchIteratorPack { @@ -61,6 +59,5 @@ public: void or_hits_into(BitVector &result, uint32_t begin_id) const; }; -} // namespace queryevel -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp index e4b3e89847c..ef25fff8aad 100644 --- a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp @@ -5,8 +5,7 @@ #include "simplesearch.h" #include "fake_search.h" -namespace search { -namespace queryeval { +namespace search::queryeval { //----------------------------------------------------------------------------- @@ -14,7 +13,7 @@ SearchIterator::UP EmptyBlueprint::createLeafSearch(const search::fef::TermFieldMatchDataArray &, bool) const { - return SearchIterator::UP(new EmptySearch()); + return std::make_unique(); } EmptyBlueprint::EmptyBlueprint(const FieldSpecBase &field) @@ -35,8 +34,7 @@ EmptyBlueprint::EmptyBlueprint() //----------------------------------------------------------------------------- SearchIterator::UP -SimpleBlueprint::createLeafSearch(const search::fef::TermFieldMatchDataArray &, - bool) const +SimpleBlueprint::createLeafSearch(const search::fef::TermFieldMatchDataArray &, bool) const { SimpleSearch *ss = new SimpleSearch(_result); SearchIterator::UP search(ss); @@ -49,13 +47,10 @@ SimpleBlueprint::SimpleBlueprint(const SimpleResult &result) _tag(), _result(result) { - setEstimate(HitEstimate(result.getHitCount(), - (result.getHitCount() == 0))); + setEstimate(HitEstimate(result.getHitCount(), (result.getHitCount() == 0))); } -SimpleBlueprint::~SimpleBlueprint() -{ -} +SimpleBlueprint::~SimpleBlueprint() = default; SimpleBlueprint & SimpleBlueprint::tag(const vespalib::string &t) @@ -67,30 +62,22 @@ SimpleBlueprint::tag(const vespalib::string &t) //----------------------------------------------------------------------------- SearchIterator::UP -FakeBlueprint::createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, - bool) const +FakeBlueprint::createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool) const { - return SearchIterator::UP(new FakeSearch(_tag, _field.getName(), _term, - _result, tfmda)); + return std::make_unique(_tag, _field.getName(), _term, _result, tfmda); } -FakeBlueprint::FakeBlueprint(const FieldSpec &field, - const FakeResult &result) +FakeBlueprint::FakeBlueprint(const FieldSpec &field, const FakeResult &result) : SimpleLeafBlueprint(field), _tag(""), _term(""), _field(field), _result(result) { - setEstimate(HitEstimate(result.inspect().size(), - result.inspect().empty())); + setEstimate(HitEstimate(result.inspect().size(), result.inspect().empty())); } -FakeBlueprint::~FakeBlueprint() -{ -} +FakeBlueprint::~FakeBlueprint() = default; -//----------------------------------------------------------------------------- -} // namespace queryeval -} // namespace search +} \ No newline at end of file diff --git a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.h b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.h index 8da81368c72..d0f3c95f140 100644 --- a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.h +++ b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.h @@ -15,8 +15,7 @@ class EmptyBlueprint : public SimpleLeafBlueprint { protected: SearchIterator::UP - createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, - bool strict) const override; + createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, bool strict) const override; public: EmptyBlueprint(const FieldSpecBaseList &fields); @@ -34,8 +33,7 @@ private: protected: SearchIterator::UP - createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, - bool strict) const override; + createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, bool strict) const override; public: SimpleBlueprint(const SimpleResult &result); @@ -56,12 +54,10 @@ private: protected: SearchIterator::UP - createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, - bool strict) const override; + createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override; public: - FakeBlueprint(const FieldSpec &field, - const FakeResult &result); + FakeBlueprint(const FieldSpec &field, const FakeResult &result); ~FakeBlueprint(); FakeBlueprint &tag(const vespalib::string &t) { diff --git a/searchlib/src/vespa/searchlib/queryeval/searchable.cpp b/searchlib/src/vespa/searchlib/queryeval/searchable.cpp index 87d42add0a7..af1908117ab 100644 --- a/searchlib/src/vespa/searchlib/queryeval/searchable.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/searchable.cpp @@ -4,8 +4,7 @@ #include "leaf_blueprints.h" #include "intermediate_blueprints.h" -namespace search { -namespace queryeval { +namespace search::queryeval { Blueprint::UP Searchable::createBlueprint(const IRequestContext & requestContext, @@ -26,5 +25,4 @@ Searchable::createBlueprint(const IRequestContext & requestContext, return result; } -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/searchable.h b/searchlib/src/vespa/searchlib/queryeval/searchable.h index 8faef2be08b..ef4c461d11f 100644 --- a/searchlib/src/vespa/searchlib/queryeval/searchable.h +++ b/searchlib/src/vespa/searchlib/queryeval/searchable.h @@ -7,11 +7,9 @@ #include #include -namespace search { +namespace search::query { class Node; } -namespace query { class Node; } - -namespace queryeval { +namespace search::queryeval { /** * Abstract class extended by components to expose content that can be @@ -56,5 +54,4 @@ public: virtual ~Searchable() {} }; -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/searchiterator.h b/searchlib/src/vespa/searchlib/queryeval/searchiterator.h index 1c3f5a9513c..63c2afd33aa 100644 --- a/searchlib/src/vespa/searchlib/queryeval/searchiterator.h +++ b/searchlib/src/vespa/searchlib/queryeval/searchiterator.h @@ -9,13 +9,11 @@ #include #include -namespace vespalib { class ObjectVisitor; }; +namespace vespalib { class ObjectVisitor; } -namespace search { +namespace search { class BitVector; } -class BitVector; - -namespace queryeval { +namespace search::queryeval { /** * This is the abstract superclass of all search objects. Each search @@ -342,8 +340,7 @@ public: }; -} // namespace queryeval -} // namespace search +} void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, const search::queryeval::SearchIterator &obj); diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h index 88060653312..d0e3868f34a 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h @@ -6,10 +6,9 @@ #include "irequestcontext.h" #include -namespace search { -namespace fef { class TermFieldMatchData; } +namespace search::fef { class TermFieldMatchData; } -namespace queryeval { +namespace search::queryeval { class SimplePhraseBlueprint : public ComplexLeafBlueprint { @@ -40,5 +39,4 @@ public: void fetchPostings(bool strict) override; }; -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/split_float.cpp b/searchlib/src/vespa/searchlib/queryeval/split_float.cpp index 62afeecc1a1..efb429f8059 100644 --- a/searchlib/src/vespa/searchlib/queryeval/split_float.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/split_float.cpp @@ -3,8 +3,7 @@ #include "split_float.h" #include -namespace search { -namespace queryeval { +namespace search::queryeval { SplitFloat::SplitFloat(const vespalib::string &input) { @@ -23,5 +22,4 @@ SplitFloat::SplitFloat(const vespalib::string &input) } } -} // namespace search::queryeval -} // namespace search +} \ No newline at end of file diff --git a/searchlib/src/vespa/searchlib/queryeval/split_float.h b/searchlib/src/vespa/searchlib/queryeval/split_float.h index 2c9f034bc9e..0f47c33c046 100644 --- a/searchlib/src/vespa/searchlib/queryeval/split_float.h +++ b/searchlib/src/vespa/searchlib/queryeval/split_float.h @@ -6,8 +6,7 @@ #include #include -namespace search { -namespace queryeval { +namespace search::queryeval { class SplitFloat { @@ -19,6 +18,5 @@ public: const vespalib::string &getPart(size_t i) const { return _parts[i]; } }; -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/termasstring.cpp b/searchlib/src/vespa/searchlib/queryeval/termasstring.cpp index 8dff666e7eb..14a6cefaf1b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/termasstring.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/termasstring.cpp @@ -37,8 +37,7 @@ using search::query::DotProduct; using search::query::WandTerm; using vespalib::string; -namespace search { -namespace queryeval { +namespace search::queryeval { vespalib::string termAsString(double float_term) { vespalib::asciistream os; @@ -114,5 +113,4 @@ string termAsString(const Node &term_node) { return visitor.term; } -} // namespace search::queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/termasstring.h b/searchlib/src/vespa/searchlib/queryeval/termasstring.h index 310ce19bb8e..c40050f0e2b 100644 --- a/searchlib/src/vespa/searchlib/queryeval/termasstring.h +++ b/searchlib/src/vespa/searchlib/queryeval/termasstring.h @@ -6,10 +6,9 @@ #include #include -namespace search { -namespace query { class Node; } +namespace search::query { class Node; } -namespace queryeval { +namespace search::queryeval { inline const vespalib::string &termAsString(const vespalib::string &term) { return term; @@ -25,6 +24,4 @@ vespalib::string termAsString(const search::query::Location &term); vespalib::string termAsString(const search::query::Node &term_node); -} // namespace search::queryeval -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h index b81d6c6f9e9..19e88466b1a 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h @@ -4,13 +4,11 @@ #include "searchable.h" #include -#include #include -namespace search { -namespace fef { class TermFieldMatchData; } +namespace search::fef { class TermFieldMatchData; } -namespace queryeval { +namespace search::queryeval { class WeightedSetTermBlueprint : public ComplexLeafBlueprint { @@ -35,13 +33,12 @@ public: // used by create visitor void addTerm(Blueprint::UP term, int32_t weight); - SearchIteratorUP createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, bool strict) const override; + SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; private: void fetchPostings(bool strict) override; }; -} // namespace search::queryeval -} // namespace search +} -- cgit v1.2.3 From 06805d1c5af36c8be0c5fdfeb959acadd2835543 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 3 Apr 2018 18:15:26 +0200 Subject: Add missing newline --- searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp | 3 +-- searchlib/src/vespa/searchlib/queryeval/split_float.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'searchlib/src') diff --git a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp index ef25fff8aad..bbfa487ae7d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp @@ -79,5 +79,4 @@ FakeBlueprint::FakeBlueprint(const FieldSpec &field, const FakeResult &result) FakeBlueprint::~FakeBlueprint() = default; - -} \ No newline at end of file +} diff --git a/searchlib/src/vespa/searchlib/queryeval/split_float.cpp b/searchlib/src/vespa/searchlib/queryeval/split_float.cpp index efb429f8059..b8d4b04e8dd 100644 --- a/searchlib/src/vespa/searchlib/queryeval/split_float.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/split_float.cpp @@ -22,4 +22,4 @@ SplitFloat::SplitFloat(const vespalib::string &input) } } -} \ No newline at end of file +} -- cgit v1.2.3 From 057bcb5ca301f475208552c75d527ee8ccade6d4 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 3 Apr 2018 18:22:40 +0200 Subject: make the test pass again as the code was already correct. --- .../tests/attribute/searchable/attribute_searchable_adapter_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'searchlib/src') diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp index d8e295cb469..1306a0aaaac 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp @@ -476,7 +476,7 @@ TEST("require that single weighted set turns filter on filter fields") { Result result = do_search(attribute_manager, node, strict); EXPECT_EQUAL(3u, result.est_hits); EXPECT_TRUE(result.iterator_dump.find("DocumentWeightSearchIterator") == vespalib::string::npos); - EXPECT_TRUE(result.iterator_dump.find("FilterAttributePostingListIteratorT") == vespalib::string::npos); + EXPECT_TRUE(result.iterator_dump.find("FilterAttributePostingListIteratorT") != vespalib::string::npos); ASSERT_EQUAL(3u, result.hits.size()); EXPECT_FALSE(result.est_empty); EXPECT_EQUAL(20u, result.hits[0].docid); -- cgit v1.2.3 From dad130fe52f05141a825ff7a7c247fc349ef3779 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 3 Apr 2018 18:28:13 +0200 Subject: Remove extra white space --- searchlib/src/vespa/searchlib/queryeval/split_float.h | 1 - 1 file changed, 1 deletion(-) (limited to 'searchlib/src') diff --git a/searchlib/src/vespa/searchlib/queryeval/split_float.h b/searchlib/src/vespa/searchlib/queryeval/split_float.h index 0f47c33c046..b55ba73e563 100644 --- a/searchlib/src/vespa/searchlib/queryeval/split_float.h +++ b/searchlib/src/vespa/searchlib/queryeval/split_float.h @@ -19,4 +19,3 @@ public: }; } - -- cgit v1.2.3 From 6a793ea51e9446845b886d0f3825a54fbd47c692 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 3 Apr 2018 18:28:53 +0200 Subject: Add newline --- searchlib/src/vespa/searchlib/queryeval/split_float.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'searchlib/src') diff --git a/searchlib/src/vespa/searchlib/queryeval/split_float.cpp b/searchlib/src/vespa/searchlib/queryeval/split_float.cpp index b8d4b04e8dd..69f62368e67 100644 --- a/searchlib/src/vespa/searchlib/queryeval/split_float.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/split_float.cpp @@ -23,3 +23,4 @@ SplitFloat::SplitFloat(const vespalib::string &input) } } + -- cgit v1.2.3