diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-08-11 12:43:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-11 12:43:59 +0200 |
commit | a40ab01cd05c17ecb29fdaa9ee47808a405131f9 (patch) | |
tree | dd20dbe579c6ddb10a8130ae7aaea8a4639e1ab5 | |
parent | 23b628143ff9ff5a09a5b4a03ec8da6bea37e246 (diff) | |
parent | 37279aaef843d0ca89a06dcfefd87d12806eac42 (diff) |
Merge pull request #18714 from vespa-engine/balder/properly-extract-feature-id-from-hashed-partition-edges
Properly access the feature name for hashed edges.
-rw-r--r-- | searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp | 8 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp b/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp index f4c49b36251..4fb1b534344 100644 --- a/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp +++ b/searchlib/src/tests/predicate/predicate_tree_annotator_test.cpp @@ -236,10 +236,10 @@ TEST("require short edge_partitions to get correct intervals and features") { EXPECT_EQUAL(4u, result.features.size()); EXPECT_EQUAL(0u, result.range_features.size()); - EXPECT_EQUAL(0ul, result.features[0]); //This is incorrect - EXPECT_EQUAL(0ul, result.features[1]); //This is incorrect - EXPECT_EQUAL(0ul, result.features[2]); //This is incorrect - EXPECT_EQUAL(0ul, result.features[3]); //This is incorrect + EXPECT_EQUAL(0xdbc38b103b5d50a9ul, result.features[0]); + EXPECT_EQUAL(0xbe6d86e3e2270b0aul, result.features[1]); + EXPECT_EQUAL(0xb2b301e26efffdc2ul, result.features[2]); + EXPECT_EQUAL(0x31afc4833c50e1d9ul, result.features[3]); checkBounds(result, "key=0", {{0x00010001, 0xffffffff}}); checkBounds(result, "key=30", {{0x00010001, 3}}); checkBounds(result, "foo=0", {{0x00020002, 0xffffffff}}); diff --git a/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp b/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp index ae207dc0039..caee997b471 100644 --- a/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp +++ b/searchlib/src/vespa/searchlib/predicate/predicate_tree_annotator.cpp @@ -194,7 +194,9 @@ PredicateTreeAnnotatorImpl::assignIntervalMarkers(const Inspector &in) { _result.features.push_back(in_hashed_partitions[i].asLong()); } for (size_t i = 0; i < in_hashed_edges.children(); ++i) { - _result.features.push_back(in_hashed_edges[i].asLong()); + const Inspector& child = in_hashed_edges[i]; + uint64_t hash = child[Predicate::HASH].asLong(); + _result.features.push_back(hash); } } else { const Inspector& in_min = in[Predicate::RANGE_MIN]; |