aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2019-09-19 12:26:33 +0000
committerHåvard Pettersen <havardpe@oath.com>2019-09-19 12:31:57 +0000
commit2a8c7760f9035b81302c94a88a6b754c792eb87c (patch)
treefdbc27ef8f4965e0174433fa646cfa3384144558 /searchcore
parentd082531b8c6244de5bc99ed887f706be3a1084df (diff)
added function identifying which elements matched
only a skeleton for now; outlines the interface between the summary generator and the matcher.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp15
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.h20
2 files changed, 35 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index 55d9655d805..72591d340a9 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -26,6 +26,8 @@ using namespace search::grouping;
using search::DocumentMetaData;
using search::LidUsageStats;
using search::FeatureSet;
+using search::StructFieldMapper;
+using search::MatchingElements;
using search::attribute::IAttributeContext;
using search::fef::MatchDataLayout;
using search::fef::MatchData;
@@ -368,4 +370,17 @@ Matcher::getRankFeatures(const DocsumRequest & req, ISearchContext & searchCtx,
return getFeatureSet(req, searchCtx, attrCtx, sessionMgr, false);
}
+MatchingElements
+Matcher::get_matching_elements(const DocsumRequest &req, ISearchContext &search_ctx,
+ IAttributeContext &attr_ctx, SessionManager &session_manager,
+ const StructFieldMapper &field_mapper)
+{
+ (void) req;
+ (void) search_ctx;
+ (void) attr_ctx;
+ (void) session_manager;
+ (void) field_mapper;
+ return MatchingElements();
+}
+
}
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.h b/searchcore/src/vespa/searchcore/proton/matching/matcher.h
index f234b76008e..3a1fad927b7 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.h
@@ -10,6 +10,8 @@
#include <vespa/searchcore/proton/matching/querylimiter.h>
#include <vespa/searchcommon/attribute/i_attribute_functor.h>
#include <vespa/searchlib/common/featureset.h>
+#include <vespa/searchlib/common/struct_field_mapper.h>
+#include <vespa/searchlib/common/matching_elements.h>
#include <vespa/searchlib/common/resultset.h>
#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/fef/fef.h>
@@ -49,6 +51,8 @@ private:
using DocsumRequest = search::engine::DocsumRequest;
using Properties = search::fef::Properties;
using my_clock = std::chrono::steady_clock;
+ using StructFieldMapper = search::StructFieldMapper;
+ using MatchingElements = search::MatchingElements;
IndexEnvironment _indexEnv;
search::fef::BlueprintFactory _blueprintFactory;
search::fef::RankSetup::SP _rankSetup;
@@ -156,6 +160,22 @@ public:
IAttributeContext & attrCtx, SessionManager &sessionManager);
/**
+ * Perform partial matching for the documents in the given docsum request
+ * to identify which struct field elements the query matched.
+ *
+ * @param req the docsum request
+ * @param search_ctx abstract view of searchable data
+ * @param attr_ctx abstract view of attribute data
+ * @param session_manager multilevel grouping session and query cache
+ * @param field_mapper knows which fields to collect information
+ * about and how they relate to each other
+ * @return matching elements
+ **/
+ MatchingElements get_matching_elements(const DocsumRequest &req, ISearchContext &search_ctx,
+ IAttributeContext &attr_ctx, SessionManager &session_manager,
+ const StructFieldMapper &field_mapper);
+
+ /**
* @return true if this rankprofile has summary-features enabled
**/
bool canProduceSummaryFeatures() const { return ! _rankSetup->getSummaryFeatures().empty(); }