summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-02-15 09:24:38 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-02-15 09:24:38 +0100
commit9bbc7e91e1e5128e2cda5712684eff3c3fc153df (patch)
treeae1efefb1b9af6bb050d9bd619a1cb316eff201e /searchlib
parent8566c73a6d360be94e4dbbc85b9ba72f77a467c0 (diff)
Also check the single item optimization too.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp13
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp2
2 files changed, 14 insertions, 1 deletions
diff --git a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp
index 3321b30a2a2..5512bb77803 100644
--- a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp
+++ b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp
@@ -132,6 +132,19 @@ TEST("test Simple") {
EXPECT_EQUAL(expect, ws.search(index, "multi-field", false));
}
+TEST("test Simple Single") {
+ FakeSearchable index;
+ setupFakeSearchable(index);
+ FakeResult expect = FakeResult()
+ .doc(7).score(70 * 7);
+ DP ws = DP().add("7", 70);
+
+ EXPECT_EQUAL(expect, ws.search(index, "field", true));
+ EXPECT_EQUAL(expect, ws.search(index, "field", false));
+ EXPECT_EQUAL(expect, ws.search(index, "multi-field", true));
+ EXPECT_EQUAL(expect, ws.search(index, "multi-field", false));
+}
+
TEST("test Multi") {
FakeSearchable index;
setupFakeSearchable(index);
diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp
index c148d3860e7..492fd7a9dad 100644
--- a/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_search.cpp
@@ -108,7 +108,7 @@ public:
void visitMembers(vespalib::ObjectVisitor &) const override {}
};
-class SingleTermDotProductSearch : public SearchIterator {
+class SingleTermDotProductSearch : public DotProductSearch {
public:
SingleTermDotProductSearch(TermFieldMatchData &tmd, SearchIterator::UP child,
const TermFieldMatchData &childTmd, feature_t weight, MatchData::UP md)