diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-01-08 14:42:36 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-01-08 14:42:36 +0000 |
commit | feef42f47a71d1bc9028d2151d6725e4917db1bd (patch) | |
tree | cc1db0f28a4f5c58a565bacd90a55a3ece8a96af /searchlib | |
parent | 290cc71ab1aa3b6c8eedd93d82351000873bb300 (diff) |
only send distanceThreshold conditionally
* abuse a bit in the "allow approximation" integer
* we want to cleanup this in several steps later.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp | 8 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/query/tree/stackdumpcreator.cpp | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp index 6feec9bbba2..ce24de02281 100644 --- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp +++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp @@ -273,7 +273,13 @@ SimpleQueryStackDumpIterator::next() _extraIntArg1 = readCompressedPositiveInt(p); // targetNumHits _extraIntArg2 = readCompressedPositiveInt(p); // allow_approximate _extraIntArg3 = readCompressedPositiveInt(p); // explore_additional_hits - _extraDoubleArg4 = read_double(p); // distance threshold + if ((_extraIntArg2 & 0x40) != 0) { + _extraIntArg2 &= ~0x40; + // in some later release, do this always: + _extraDoubleArg4 = read_double(p); // distance threshold + } else { + _extraDoubleArg4 = std::numeric_limits<double>::max(); + } _currArity = 0; } catch (...) { return false; diff --git a/searchlib/src/vespa/searchlib/query/tree/stackdumpcreator.cpp b/searchlib/src/vespa/searchlib/query/tree/stackdumpcreator.cpp index a006e66310c..d2ac46157b1 100644 --- a/searchlib/src/vespa/searchlib/query/tree/stackdumpcreator.cpp +++ b/searchlib/src/vespa/searchlib/query/tree/stackdumpcreator.cpp @@ -263,7 +263,8 @@ class QueryNodeConverter : public QueryVisitor { createTermNode(node, ParseItem::ITEM_NEAREST_NEIGHBOR); appendString(node.get_query_tensor_name()); appendCompressedPositiveNumber(node.get_target_num_hits()); - appendCompressedPositiveNumber(node.get_allow_approximate() ? 1 : 0); + // XXX subtract 0x40 later: + appendCompressedPositiveNumber(node.get_allow_approximate() ? 0x41 : 0x40); appendCompressedPositiveNumber(node.get_explore_additional_hits()); appendDouble(node.get_distance_threshold()); } |