diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-27 15:35:25 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-07-25 11:49:17 +0200 |
commit | 7c70886a64a4327d240c8833203c15b276107a7a (patch) | |
tree | ab4b2c036796d521ab42123d3c9901964024ad5c /searchlib | |
parent | 8767895ce5d5d69eda6a0611953ff64a7164800f (diff) |
Include less
Diffstat (limited to 'searchlib')
20 files changed, 54 insertions, 97 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp index 52e74e4ab9f..60b8b1603c8 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp @@ -58,7 +58,6 @@ using search::queryeval::DotProductBlueprint; using search::queryeval::FieldSpec; using search::queryeval::FieldSpecBaseList; using search::queryeval::IRequestContext; -using search::queryeval::MultiSearch; using search::queryeval::NoUnpack; using search::queryeval::OrLikeSearch; using search::queryeval::OrSearch; @@ -149,7 +148,7 @@ AttributeFieldBlueprint::visitMembers(vespalib::ObjectVisitor &visitor) const template <bool is_strict> struct LocationPreFilterIterator : public OrLikeSearch<is_strict, NoUnpack> { - LocationPreFilterIterator(const MultiSearch::Children &children) : OrLikeSearch<is_strict, NoUnpack>(children, NoUnpack()) {} + LocationPreFilterIterator(const std::vector<SearchIterator *> &children) : OrLikeSearch<is_strict, NoUnpack>(children, NoUnpack()) {} virtual void doUnpack(uint32_t) override {} }; @@ -195,7 +194,7 @@ public: virtual SearchIterator::UP createLeafSearch(const TermFieldMatchDataArray &tfmda, bool strict) const override { - MultiSearch::Children children; + std::vector<SearchIterator *> children; for (auto it(_rangeSearches.begin()), mt(_rangeSearches.end()); it != mt; it++) { children.push_back((*it)->createIterator(tfmda[0], strict).release()); diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp index d949a86bac4..5c26b19f436 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp @@ -5,6 +5,7 @@ #include <vespa/searchlib/queryeval/weighted_set_term_search.h> #include <vespa/searchlib/query/queryterm.h> #include <vespa/searchlib/common/bitvector.h> +#include <vespa/vespalib/stllike/hash_map.h> namespace search { diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp index 21c955f5506..e2c3dafc13d 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp @@ -21,8 +21,7 @@ using search::queryeval::LeafBlueprint; using search::queryeval::EquivBlueprint; using search::queryeval::Blueprint; -namespace search { -namespace diskindex { +namespace search::diskindex { namespace { @@ -97,6 +96,4 @@ DiskTermBlueprint::createLeafSearch(const TermFieldMatchDataArray & tfmda, bool return search; } -} // namespace diskindex -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h index e1b3876bc1c..f7806235533 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h @@ -5,8 +5,7 @@ #include "diskindex.h" #include <vespa/searchlib/queryeval/blueprint.h> -namespace search { -namespace diskindex { +namespace search::diskindex { /** * Blueprint implementation for term searching in a disk index. @@ -39,11 +38,9 @@ public: // Inherit doc from Blueprint. // For now, this DiskTermBlueprint instance must have longer lifetime than the created iterator. - search::queryeval::SearchIterator::UP createLeafSearch(const search::fef::TermFieldMatchDataArray & tfmda, bool strict) const override; + std::unique_ptr<queryeval::SearchIterator> createLeafSearch(const fef::TermFieldMatchDataArray & tfmda, bool strict) const override; void fetchPostings(bool strict) override; }; -} // namespace diskindex -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/fieldinfo.h b/searchlib/src/vespa/searchlib/fef/fieldinfo.h index 24e6abb772a..ce009ba68c0 100644 --- a/searchlib/src/vespa/searchlib/fef/fieldinfo.h +++ b/searchlib/src/vespa/searchlib/fef/fieldinfo.h @@ -2,12 +2,11 @@ #pragma once -#include <vespa/vespalib/stllike/string.h> #include "fieldtype.h" #include <vespa/searchcommon/common/datatype.h> +#include <vespa/vespalib/stllike/string.h> -namespace search { -namespace fef { +namespace search::fef { const uint32_t IllegalFieldId = 0xffffffff; @@ -107,6 +106,4 @@ public: bool isFilter() const { return _isFilter; } }; -} // namespace fef -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.h b/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.h index a4b884d2391..0084483d0a3 100644 --- a/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.h +++ b/searchlib/src/vespa/searchlib/fef/fieldpositionsiterator.h @@ -4,8 +4,7 @@ #include "termfieldmatchdataposition.h" -namespace search { -namespace fef { +namespace search::fef { /** * Iterator used to iterate over all positions of a term inside a @@ -158,6 +157,4 @@ public: uint32_t size() const { return (_end - _begin); } }; -} // namespace fef -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/fieldtype.h b/searchlib/src/vespa/searchlib/fef/fieldtype.h index 29ca33b6b96..32879ecfb5d 100644 --- a/searchlib/src/vespa/searchlib/fef/fieldtype.h +++ b/searchlib/src/vespa/searchlib/fef/fieldtype.h @@ -2,8 +2,7 @@ #pragma once -namespace search { -namespace fef { +namespace search::fef { /** * Scoped and typesafe enum used to indicate the type of a field. @@ -14,6 +13,4 @@ enum class FieldType { HIDDEN_ATTRIBUTE = 3 }; -} // namespace fef -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/handle.h b/searchlib/src/vespa/searchlib/fef/handle.h index 4226f0fbf38..af2ed4fd581 100644 --- a/searchlib/src/vespa/searchlib/fef/handle.h +++ b/searchlib/src/vespa/searchlib/fef/handle.h @@ -2,16 +2,13 @@ #pragma once -#include <stdint.h> +#include <cstdint> -namespace search { -namespace fef { +namespace search::fef { typedef uint32_t FeatureHandle; typedef uint32_t TermFieldHandle; const uint32_t IllegalHandle = 0xffffffff; -} // namespace fef -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/matchdata.h b/searchlib/src/vespa/searchlib/fef/matchdata.h index e07d3e1cd04..472b34a823f 100644 --- a/searchlib/src/vespa/searchlib/fef/matchdata.h +++ b/searchlib/src/vespa/searchlib/fef/matchdata.h @@ -7,8 +7,7 @@ #include <memory> #include <vector> -namespace search { -namespace fef { +namespace search::fef { /** * An object of this class is used to store all basic data and derived @@ -99,5 +98,4 @@ public: static MatchData::UP makeTestInstance(uint32_t numTermFields, uint32_t fieldIdLimit); }; -} // namespace fef -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h index 945186c6bf5..e921e533cc3 100644 --- a/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h +++ b/searchlib/src/vespa/searchlib/fef/termfieldmatchdata.h @@ -5,13 +5,12 @@ #include "fieldpositionsiterator.h" #include "fieldinfo.h" #include <vespa/searchlib/common/feature.h> -#include <string.h> -#include <assert.h> +#include <cstring> +#include <cassert> class MatchDataHeapTest; -namespace search { -namespace fef { +namespace search::fef { class TermMatchDataMerger; @@ -274,6 +273,4 @@ public: static uint32_t invalidId() { return 0xdeadbeefU; } } __attribute__((packed)); -} // namespace fef -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/termfieldmatchdataposition.h b/searchlib/src/vespa/searchlib/fef/termfieldmatchdataposition.h index 820fdfb7cb5..46e4379c5b2 100644 --- a/searchlib/src/vespa/searchlib/fef/termfieldmatchdataposition.h +++ b/searchlib/src/vespa/searchlib/fef/termfieldmatchdataposition.h @@ -5,8 +5,7 @@ #include <vespa/searchlib/common/fslimits.h> #include <cstdint> -namespace search { -namespace fef { +namespace search::fef { class TermFieldMatchDataPositionKey { @@ -105,5 +104,4 @@ public: } }; -} // namespace fef -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.h b/searchlib/src/vespa/searchlib/queryeval/blueprint.h index 1d208338371..56c0d166fd2 100644 --- a/searchlib/src/vespa/searchlib/queryeval/blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.h @@ -3,24 +3,17 @@ #pragma once #include "field_spec.h" +#include "unpackinfo.h" #include <vespa/searchlib/fef/handle.h> #include <vespa/searchlib/fef/matchdata.h> #include <vespa/searchlib/fef/termfieldmatchdata.h> #include <vespa/searchlib/fef/termfieldmatchdataarray.h> -#include <vespa/searchlib/queryeval/searchiterator.h> -#include <vespa/searchlib/queryeval/multisearch.h> -#include <vespa/searchlib/queryeval/unpackinfo.h> -#include <vespa/vespalib/util/array.h> -#include <vespa/vespalib/stllike/hash_map.h> -#include <vector> -#include <memory> - namespace vespalib { class ObjectVisitor; }; -namespace search { -namespace queryeval { +namespace search::queryeval { +class SearchIterator; /** * A Blueprint is an intermediate representation of a search. More @@ -36,6 +29,7 @@ class Blueprint { public: typedef std::unique_ptr<Blueprint> UP; + typedef std::unique_ptr<SearchIterator> SearchIteratorUP; struct HitEstimate { uint32_t estHits; @@ -175,7 +169,7 @@ public: virtual void freeze() = 0; bool frozen() const { return _frozen; } - virtual SearchIterator::UP createSearch(fef::MatchData &md, bool strict) const = 0; + virtual SearchIteratorUP createSearch(fef::MatchData &md, bool strict) const = 0; // for debug dumping vespalib::string asString() const; @@ -258,14 +252,14 @@ public: IntermediateBlueprint & insertChild(size_t n, Blueprint::UP child); IntermediateBlueprint &addChild(Blueprint::UP child); Blueprint::UP removeChild(size_t n); - SearchIterator::UP createSearch(fef::MatchData &md, bool strict) const override; + SearchIteratorUP createSearch(fef::MatchData &md, bool strict) const override; virtual HitEstimate combine(const std::vector<HitEstimate> &data) const = 0; virtual FieldSpecBaseList exposeFields() const = 0; virtual void sort(std::vector<Blueprint*> &children) const = 0; virtual bool inheritStrict(size_t i) const = 0; - virtual SearchIterator::UP - createIntermediateSearch(const MultiSearch::Children &subSearches, + virtual SearchIteratorUP + createIntermediateSearch(const std::vector<SearchIterator *> &subSearches, bool strict, fef::MatchData &md) const = 0; void visitMembers(vespalib::ObjectVisitor &visitor) const override; @@ -295,10 +289,10 @@ public: void setDocIdLimit(uint32_t limit) override final { Blueprint::setDocIdLimit(limit); } void fetchPostings(bool strict) override; void freeze() override final; - SearchIterator::UP createSearch(fef::MatchData &md, bool strict) const override; + SearchIteratorUP createSearch(fef::MatchData &md, bool strict) const override; - virtual SearchIterator::UP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, - bool strict) const = 0; + virtual SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, + bool strict) const = 0; }; // for leaf nodes representing a single term @@ -315,8 +309,7 @@ struct ComplexLeafBlueprint : LeafBlueprint { //----------------------------------------------------------------------------- -} // namespace queryeval -} // namespace search +} void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, const search::queryeval::Blueprint &obj); diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h index b58260225dc..80599f771d0 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h @@ -30,7 +30,7 @@ public: // used by create visitor void addTerm(Blueprint::UP term, int32_t weight); - SearchIterator::UP + SearchIteratorUP createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, bool strict) const override; @@ -40,4 +40,3 @@ public: } // namespace search::queryeval } // namespace search - diff --git a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h index 81498c8c85e..09a41ab13df 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h @@ -24,7 +24,7 @@ public: // used by create visitor EquivBlueprint& addTerm(Blueprint::UP term, double exactness); - SearchIterator::UP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override; + SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; void fetchPostings(bool strict) override; diff --git a/searchlib/src/vespa/searchlib/queryeval/field_spec.h b/searchlib/src/vespa/searchlib/queryeval/field_spec.h index b149e538d52..7da3d6a8ecc 100644 --- a/searchlib/src/vespa/searchlib/queryeval/field_spec.h +++ b/searchlib/src/vespa/searchlib/queryeval/field_spec.h @@ -7,9 +7,7 @@ #include <vector> #include <vespa/vespalib/stllike/string.h> -namespace search { - -namespace queryeval { +namespace search::queryeval { /** @@ -114,6 +112,4 @@ public: } }; -} // namespace queryeval -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/queryeval/orlikesearch.h b/searchlib/src/vespa/searchlib/queryeval/orlikesearch.h index 41043a24963..1dec50ffc97 100644 --- a/searchlib/src/vespa/searchlib/queryeval/orlikesearch.h +++ b/searchlib/src/vespa/searchlib/queryeval/orlikesearch.h @@ -5,8 +5,7 @@ #include "orsearch.h" #include <vespa/vespalib/objects/visit.h> -namespace search { -namespace queryeval { +namespace search::queryeval { /** * A simple implementation of the Or search operation. @@ -68,5 +67,4 @@ private: }; -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h index fe186d07b5c..88060653312 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h @@ -33,7 +33,7 @@ public: // used by create visitor void addTerm(Blueprint::UP term); - SearchIterator::UP + SearchIteratorUP createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, bool strict) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; diff --git a/searchlib/src/vespa/searchlib/queryeval/unpackinfo.h b/searchlib/src/vespa/searchlib/queryeval/unpackinfo.h index 7263addea46..862657f2d28 100644 --- a/searchlib/src/vespa/searchlib/queryeval/unpackinfo.h +++ b/searchlib/src/vespa/searchlib/queryeval/unpackinfo.h @@ -2,12 +2,11 @@ #pragma once -#include <string.h> -#include <stdint.h> -#include "multisearch.h" +#include <vespa/vespalib/stllike/string.h> -namespace search { -namespace queryeval { +namespace search::queryeval { + +class MultiSearch; class UnpackInfo { @@ -65,5 +64,4 @@ struct NoUnpack { bool needUnpack(size_t index) const { (void) index; return false; } }; -} // namespace queryeval -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp index 088e961d975..0c9af1d3e25 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp @@ -4,8 +4,7 @@ #include "weighted_set_term_search.h" #include <vespa/vespalib/objects/visit.hpp> -namespace search { -namespace queryeval { +namespace search::queryeval { WeightedSetTermBlueprint::WeightedSetTermBlueprint(const FieldSpec &field) : ComplexLeafBlueprint(field), @@ -78,5 +77,4 @@ WeightedSetTermBlueprint::createLeafSearch(const search::fef::TermFieldMatchData abort(); } -} // 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 d783a9b5af1..1afa0f9f2b2 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h @@ -34,11 +34,11 @@ public: // used by create visitor void addTerm(Blueprint::UP term, int32_t weight); - SearchIterator::UP createSearch(search::fef::MatchData &md, bool strict) const override; + SearchIteratorUP createSearch(search::fef::MatchData &md, bool strict) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; private: - SearchIterator::UP createLeafSearch(const search::fef::TermFieldMatchDataArray &, bool) const override; + SearchIteratorUP createLeafSearch(const search::fef::TermFieldMatchDataArray &, bool) const override; void fetchPostings(bool strict) override; }; |