Use a query that actually produce a non-zeroo result.
@@ -1048,11 +1048,13 @@ Test::setupForDocumentTest(FtFeatureTest &ft, const vespalib::string & attrName,
namespace {
void
-verifyCorrectDotProductExecutor(BlueprintFactory & factory, vespalib::stringref attrName, vespalib::stringref expected) {
+verifyCorrectDotProductExecutor(BlueprintFactory & factory, vespalib::stringref attrName,
+ vespalib::stringref queryVector, vespalib::stringref expected)
+{
ParameterList params = {{ParameterType::ATTRIBUTE, attrName}, {ParameterType::STRING, "vector"}};
FtFeatureTest ft(factory, "value(0)");
Test::setupForDotProductTest(ft);
- ft.getQueryEnv().getProperties().add("dotProduct.vector", "(7:1)");
+ ft.getQueryEnv().getProperties().add("dotProduct.vector", queryVector);
DotProductBlueprint bp;
DummyDependencyHandler deps(bp);
EXPECT_TRUE(bp.setup(ft.getIndexEnv(), params));
@@ -1225,8 +1227,8 @@ Test::testDotProduct()
assertDotProduct(17, "(0:1,3:4,50:97)", 1, "sint", "arrfloat"); // attribute override
assertDotProduct(0, "(0:1,3:4,50:97)", 1, "sint", "arrfloat_non_existing"); // incorrect attribute override
}
- verifyCorrectDotProductExecutor(_factory, "wsstr", "search::features::dotproduct::wset::(anonymous namespace)::DotProductExecutorByEnum");
- verifyCorrectDotProductExecutor(_factory, "wsint", "search::features::dotproduct::wset::DotProductExecutor<search::MultiValueNumericAttribute<search::IntegerAttributeTemplate<int>, search::multivalue::WeightedValue<int> > >");
+ verifyCorrectDotProductExecutor(_factory, "wsstr", "{a:1}", "search::features::dotproduct::wset::(anonymous namespace)::DotProductExecutorByEnum");
+ verifyCorrectDotProductExecutor(_factory, "wsint", "{1:1}", "search::features::dotproduct::wset::DotProductExecutor<search::MultiValueNumericAttribute<search::IntegerAttributeTemplate<int>, search::multivalue::WeightedValue<int> > >");
}
void
