summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/features
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-11-20 18:15:32 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-11-20 18:15:32 +0000
commit37c0e98af2ab7fbeb307019a20e572def4f1ddb6 (patch)
tree02312684c58dea559b7ade43ab30abc86c9ea0a8 /searchlib/src/tests/features
parentb693d572df945b9e82798e0c40b8b7b565f6a4a8 (diff)
Separate where you nede an actual hash, and where you want the string hashed to a double.
Diffstat (limited to 'searchlib/src/tests/features')
-rw-r--r--searchlib/src/tests/features/prod_features.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/searchlib/src/tests/features/prod_features.cpp b/searchlib/src/tests/features/prod_features.cpp
index 80650050b25..73b66f36172 100644
--- a/searchlib/src/tests/features/prod_features.cpp
+++ b/searchlib/src/tests/features/prod_features.cpp
@@ -251,13 +251,13 @@ Test::testAttribute()
addScore("attribute(sebool)", 0).
addScore("attribute(sfloat)", 60.5f).
addScore("attribute(sdouble)", 67.5f).
- addScore("attribute(sstr)", (feature_t)vespalib::hash_code("foo")).
+ addScore("attribute(sstr)", vespalib::hash2d("foo")).
addScore("attribute(sint).count", 1).
addScore("attribute(sfloat).count", 1).
addScore("attribute(sstr).count", 1).
addScore("attribute(udefint)", search::attribute::getUndefined<feature_t>()).
addScore("attribute(udeffloat)", search::attribute::getUndefined<feature_t>()).
- addScore("attribute(udefstr)", (feature_t)vespalib::hash_code(""));
+ addScore("attribute(udefstr)", vespalib::hash2d(""));
FtFeatureTest ft(_factory, exp.getKeys());
ft.getIndexEnv().getBuilder()
@@ -284,8 +284,8 @@ Test::testAttribute()
addScore("attribute(aint,2)", 0).
addScore("attribute(afloat,0)", 70.5f).
addScore("attribute(afloat,1)", 80.5f).
- addScore("attribute(astr,0)", (feature_t)vespalib::hash_code("bar")).
- addScore("attribute(astr,1)", (feature_t)vespalib::hash_code("baz")).
+ addScore("attribute(astr,0)", vespalib::hash2d("bar")).
+ addScore("attribute(astr,1)", vespalib::hash2d("baz")).
addScore("attribute(aint).count", 2).
addScore("attribute(aint,0).count", 0).
addScore("attribute(afloat).count", 2).
@@ -333,10 +333,10 @@ Test::testAttribute()
addScore("attribute(wsstr,foo).value", 0).
addScore("attribute(wsstr,foo).weight", 0).
addScore("attribute(wsstr,foo).contains", 0).
- addScore("attribute(wsstr,qux).value", (feature_t)vespalib::hash_code("qux")).
+ addScore("attribute(wsstr,qux).value", vespalib::hash2d("qux")).
addScore("attribute(wsstr,qux).weight", 11).
addScore("attribute(wsstr,qux).contains", 1).
- addScore("attribute(wsstr,quux).value", (feature_t)vespalib::hash_code("quux")).
+ addScore("attribute(wsstr,quux).value", vespalib::hash2d("quux")).
addScore("attribute(wsstr,quux).weight", 12).
addScore("attribute(wsstr,quux).contains", 1).
addScore("attribute(wsint).count", 2).
@@ -1762,10 +1762,10 @@ Test::testQuery()
addScore("query(def3)", 0.0).
addScore("query(val1)", 1.1).
addScore("query(val2)", 2.2).
- addScore("query(hash1)", vespalib::hash_code("foo")).
- addScore("query(hash2)", vespalib::hash_code("2")).
- addScore("query(hash3)", vespalib::hash_code("foo")).
- addScore("query(hash4)", vespalib::hash_code("'foo"));
+ addScore("query(hash1)", vespalib::hash2d("foo")).
+ addScore("query(hash2)", vespalib::hash2d("2")).
+ addScore("query(hash3)", vespalib::hash2d("foo")).
+ addScore("query(hash4)", vespalib::hash2d("'foo"));
FtFeatureTest ft(_factory, exp.getKeys());
ft.getIndexEnv().getProperties()
.add("query(def1)", "1.0")