diff options
author | Henning Baldersheim <balder@oath.com> | 2018-08-15 09:28:42 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-08-27 09:22:14 +0200 |
commit | be6729d2eadb3abe61613acb82c59a137ccf12a0 (patch) | |
tree | 7e648f022c922ce8cc700bff77089a2aa2527ce0 /searchcore/src/tests | |
parent | 73ed7ad7c3cbd41d5ca44c4f2f7ae547fe4c5abe (diff) |
- Add option to increment an attribute for every doc matched.
- Add option to increment an attribute for every doc reranked.
- Add option to increment an attribute for every doc fetched.
Conflicts:
searchcore/src/vespa/searchcore/proton/matching/attribute_operation.cpp
Conflicts:
searchlib/src/vespa/searchlib/attribute/i_attribute_functor.h
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r-- | searchcore/src/tests/proton/matching/matching_test.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp index 293d87870e5..8d75c8b8d24 100644 --- a/searchcore/src/tests/proton/matching/matching_test.cpp +++ b/searchcore/src/tests/proton/matching/matching_test.cpp @@ -327,10 +327,14 @@ struct MyWorld { } }; + struct DummyAttributeExecutor : public IAttributeExecutor { + void asyncForAttribute(const vespalib::string &, std::shared_ptr<IAttributeFunctor>) const override {} + }; void verify_diversity_filter(SearchRequest::SP req, bool expectDiverse) { Matcher::SP matcher = createMatcher(); search::fef::Properties overrides; - auto mtf = matcher->create_match_tools_factory(*req, searchContext, attributeContext, metaStore, overrides); + DummyAttributeExecutor attrExec; + auto mtf = matcher->create_match_tools_factory(*req, searchContext, attributeContext, attrExec, metaStore, overrides); auto diversity = mtf->createDiversifier(); EXPECT_EQUAL(expectDiverse, static_cast<bool>(diversity)); } @@ -339,8 +343,9 @@ struct MyWorld { Matcher::SP matcher = createMatcher(); SearchRequest::SP request = createSimpleRequest("f1", "spread"); search::fef::Properties overrides; + DummyAttributeExecutor attrExec; MatchToolsFactory::UP match_tools_factory = matcher->create_match_tools_factory( - *request, searchContext, attributeContext, metaStore, overrides); + *request, searchContext, attributeContext, attrExec, metaStore, overrides); MatchTools::UP match_tools = match_tools_factory->createMatchTools(); match_tools->setup_first_phase(); return match_tools->match_data().get_termwise_limit(); @@ -353,8 +358,9 @@ struct MyWorld { owned_objects.context.reset(new MatchContext(std::make_unique<MyAttributeContext>(), std::make_unique<FakeSearchContext>())); vespalib::SimpleThreadBundle threadBundle(threads); + DummyAttributeExecutor attrExec; SearchReply::UP reply = matcher->match(*req, threadBundle, searchContext, attributeContext, - *sessionManager, metaStore, std::move(owned_objects)); + attrExec, *sessionManager, metaStore, std::move(owned_objects)); matchingStats.add(matcher->getStats()); return reply; } @@ -386,12 +392,14 @@ struct MyWorld { FeatureSet::SP getSummaryFeatures(DocsumRequest::SP req) { Matcher::SP matcher = createMatcher(); - return matcher->getSummaryFeatures(*req, searchContext, attributeContext, *sessionManager); + DummyAttributeExecutor attrExec; + return matcher->getSummaryFeatures(*req, searchContext, attributeContext, attrExec, *sessionManager); } FeatureSet::SP getRankFeatures(DocsumRequest::SP req) { Matcher::SP matcher = createMatcher(); - return matcher->getRankFeatures(*req, searchContext, attributeContext, *sessionManager); + DummyAttributeExecutor attrExec; + return matcher->getRankFeatures(*req, searchContext, attributeContext, attrExec, *sessionManager); } }; |