From c5a339d82ddfeea8b4421e3994f272c23ac29af4 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Fri, 21 Jun 2019 21:45:41 +0200 Subject: Tag match data for children of near search as needing unpack of normal features. --- .../queryeval/intermediate_blueprints.cpp | 28 ++++++++++++++++++++++ .../searchlib/queryeval/intermediate_blueprints.h | 2 ++ 2 files changed, 30 insertions(+) (limited to 'searchlib') 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:: //----------------------------------------------------------------------------- @@ -374,6 +388,13 @@ NearBlueprint::inheritStrict(size_t i) const return (i == 0); } +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 @@ -415,6 +436,13 @@ ONearBlueprint::inheritStrict(size_t i) const return (i == 0); } +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 &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 &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; -- cgit v1.2.3