diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-06-24 09:33:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 09:33:42 +0200 |
commit | 2da125f0babd1aa4314811e8e80ec4e127786102 (patch) | |
tree | c86eb161cbb44281e6552c125556eda8f53d9209 | |
parent | 9e689afe191b23bc3a5d51113ee6462a00113adb (diff) | |
parent | c5a339d82ddfeea8b4421e3994f272c23ac29af4 (diff) |
Merge pull request #9878 from vespa-engine/toregge/tag-termfieldmatchdata-for-children-of-near-search-as-needing-unpack-of-normal-features
Tag match data for children of near search as needing unpack of normal features.
-rw-r--r-- | searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp | 28 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp index 0a11203c390..bf7b659dea7 100644 --- a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp @@ -68,6 +68,20 @@ void optimize_source_blenders(IntermediateBlueprint &self, size_t begin_idx) { } } +void +need_normal_features_for_children(const IntermediateBlueprint &blueprint, fef::MatchData &md) +{ + for (size_t i = 0; i < blueprint.childCnt(); ++i) { + const Blueprint::State &cs = blueprint.getChild(i).getState(); + for (size_t j = 0; j < cs.numFields(); ++j) { + auto *tfmd = cs.field(j).resolve(md); + if (tfmd != nullptr) { + tfmd->setNeedNormalFeatures(true); + } + } + } +} + } // namespace search::queryeval::<unnamed> //----------------------------------------------------------------------------- @@ -375,6 +389,13 @@ NearBlueprint::inheritStrict(size_t i) const } SearchIterator::UP +NearBlueprint::createSearch(fef::MatchData &md, bool strict) const +{ + need_normal_features_for_children(*this, md); + return IntermediateBlueprint::createSearch(md, strict); +} + +SearchIterator::UP NearBlueprint::createIntermediateSearch(const MultiSearch::Children &subSearches, bool strict, search::fef::MatchData &md) const { @@ -416,6 +437,13 @@ ONearBlueprint::inheritStrict(size_t i) const } SearchIterator::UP +ONearBlueprint::createSearch(fef::MatchData &md, bool strict) const +{ + need_normal_features_for_children(*this, md); + return IntermediateBlueprint::createSearch(md, strict); +} + +SearchIterator::UP ONearBlueprint::createIntermediateSearch(const MultiSearch::Children &subSearches, bool strict, search::fef::MatchData &md) const { diff --git a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h index 440794c25d8..a217c8f303d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h +++ b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h @@ -102,6 +102,7 @@ public: bool should_optimize_children() const override { return false; } void sort(std::vector<Blueprint*> &children) const override; bool inheritStrict(size_t i) const override; + SearchIteratorUP createSearch(fef::MatchData &md, bool strict) const override; SearchIterator::UP createIntermediateSearch(const MultiSearch::Children &subSearches, bool strict, fef::MatchData &md) const override; @@ -122,6 +123,7 @@ public: bool should_optimize_children() const override { return false; } void sort(std::vector<Blueprint*> &children) const override; bool inheritStrict(size_t i) const override; + SearchIteratorUP createSearch(fef::MatchData &md, bool strict) const override; SearchIterator::UP createIntermediateSearch(const MultiSearch::Children &subSearches, bool strict, fef::MatchData &md) const override; |