aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp5
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp38
-rw-r--r--searchcore/src/tests/proton/summaryengine/summaryengine.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/result_processor.h4
-rw-r--r--searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/common/transport.h35
-rw-r--r--searchlib/src/vespa/searchlib/engine/proto_converter.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/engine/request.cpp9
-rw-r--r--searchlib/src/vespa/searchlib/engine/request.h4
-rw-r--r--searchsummary/src/tests/docsummary/slime_summary/slime_summary_test.cpp3
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp3
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h2
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp5
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h6
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp21
18 files changed, 49 insertions, 112 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 0a9f3127844..0e521e473ae 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -23,7 +23,6 @@
#include <vespa/searchcore/proton/server/searchview.h>
#include <vespa/searchcore/proton/server/summaryadapter.h>
#include <vespa/searchlib/common/gatecallback.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/searchlib/engine/docsumapi.h>
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
@@ -359,7 +358,7 @@ Test::assertTensor(const Tensor::UP & exp, const std::string & fieldName,
uint32_t classId;
ASSERT_LESS_EQUAL(sizeof(classId), docsum.data.size());
memcpy(&classId, docsum.data.c_str(), sizeof(classId));
- ASSERT_EQUAL(::search::fs4transport::SLIME_MAGIC_ID, classId);
+ ASSERT_EQUAL(::search::docsummary::SLIME_MAGIC_ID, classId);
vespalib::Slime slime;
vespalib::Memory serialized(docsum.data.c_str() + sizeof(classId),
docsum.data.size() - sizeof(classId));
@@ -384,7 +383,7 @@ getSlime(const DocsumReply &reply, uint32_t id, bool relaxed)
uint32_t classId;
ASSERT_LESS_EQUAL(sizeof(classId), docsum.data.size());
memcpy(&classId, docsum.data.c_str(), sizeof(classId));
- ASSERT_EQUAL(::search::fs4transport::SLIME_MAGIC_ID, classId);
+ ASSERT_EQUAL(search::docsummary::SLIME_MAGIC_ID, classId);
vespalib::Slime slime;
vespalib::Memory serialized(docsum.data.c_str() + sizeof(classId),
docsum.data.size() - sizeof(classId));
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index 3f68b54aca2..950321533b0 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.cpp
@@ -18,7 +18,6 @@
#include <vespa/searchlib/aggregation/perdocexpression.h>
#include <vespa/searchlib/attribute/extendableattributes.h>
#include <vespa/searchlib/common/featureset.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/searchlib/engine/docsumrequest.h>
#include <vespa/searchlib/engine/searchrequest.h>
#include <vespa/searchlib/engine/docsumreply.h>
@@ -573,27 +572,22 @@ TEST("require that re-ranking is diverse with diversity = 1/10") {
}
TEST("require that sortspec can be used (multi-threaded)") {
- for (bool drop_sort_data: {false, true}) {
- for (size_t threads = 1; threads <= 16; ++threads) {
- MyWorld world;
- world.basicSetup();
- world.basicResults();
- SearchRequest::SP request = world.createSimpleRequest("f1", "spread");
- request->sortSpec = "+a1";
- if (drop_sort_data) {
- request->queryFlags |= fs4transport::QFLAG_DROP_SORTDATA;
- }
- SearchReply::UP reply = world.performSearch(request, threads);
- ASSERT_EQUAL(9u, reply->hits.size());
- EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::100").getGlobalId(), reply->hits[0].gid);
- EXPECT_EQUAL(zero_rank_value, reply->hits[0].metric);
- EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::200").getGlobalId(), reply->hits[1].gid);
- EXPECT_EQUAL(zero_rank_value, reply->hits[1].metric);
- EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::300").getGlobalId(), reply->hits[2].gid);
- EXPECT_EQUAL(zero_rank_value, reply->hits[2].metric);
- EXPECT_EQUAL(drop_sort_data, reply->sortIndex.empty());
- EXPECT_EQUAL(drop_sort_data, reply->sortData.empty());
- }
+ for (size_t threads = 1; threads <= 16; ++threads) {
+ MyWorld world;
+ world.basicSetup();
+ world.basicResults();
+ SearchRequest::SP request = world.createSimpleRequest("f1", "spread");
+ request->sortSpec = "+a1";
+ SearchReply::UP reply = world.performSearch(request, threads);
+ ASSERT_EQUAL(9u, reply->hits.size());
+ EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::100").getGlobalId(), reply->hits[0].gid);
+ EXPECT_EQUAL(zero_rank_value, reply->hits[0].metric);
+ EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::200").getGlobalId(), reply->hits[1].gid);
+ EXPECT_EQUAL(zero_rank_value, reply->hits[1].metric);
+ EXPECT_EQUAL(document::DocumentId("id:ns:searchdocument::300").getGlobalId(), reply->hits[2].gid);
+ EXPECT_EQUAL(zero_rank_value, reply->hits[2].metric);
+ EXPECT_FALSE(reply->sortIndex.empty());
+ EXPECT_FALSE(reply->sortData.empty());
}
}
diff --git a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
index 23ef86a46b7..a9cae7d8ab7 100644
--- a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
+++ b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
@@ -7,7 +7,7 @@
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
#include <vespa/vespalib/data/databuffer.h>
#include <vespa/vespalib/util/compressor.h>
-#include <vespa/searchlib/common/transport.h>
+#include <vespa/searchsummary/docsummary/docsumwriter.h>
#include <vespa/metrics/metricset.h>
#include <vespa/fnet/frt/rpcrequest.h>
@@ -336,7 +336,7 @@ void
createSummary(search::RawBuf &buf) {
vespalib::Slime summary;
summary.setObject().setLong("long", 982);
- uint32_t magic = search::fs4transport::SLIME_MAGIC_ID;
+ uint32_t magic = search::docsummary::SLIME_MAGIC_ID;
buf.append(&magic, sizeof(magic));
search::SlimeOutputRawBufAdapter adapter(buf);
BinaryFormat::encode(summary, adapter);
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
index c65257e7f6a..5951d07a2cb 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
@@ -5,7 +5,6 @@
#include <vespa/searchlib/attribute/iattributemanager.h>
#include <vespa/searchlib/common/location.h>
#include <vespa/searchlib/common/matching_elements.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/util/stringfmt.h>
@@ -50,7 +49,6 @@ DocsumContext::initState()
{
const DocsumRequest & req = _request;
_docsumState._args.initFromDocsumRequest(req);
- _docsumState._args.SetQueryFlags(req.queryFlags & ~search::fs4transport::QFLAG_DROP_SORTDATA);
_docsumState._docsumcnt = req.hits.size();
_docsumState._docsumbuf = (_docsumState._docsumcnt > 0)
@@ -176,7 +174,7 @@ DocsumContext::FillRankFeatures(search::docsummary::GetDocsumsState * state, sea
{
assert(&_docsumState == state);
// check if we are allowed to run
- if ((state->_args.GetQueryFlags() & search::fs4transport::QFLAG_DUMP_FEATURES) == 0) {
+ if ( ! state->_args.dumpFeatures()) {
return;
}
state->_rankFeatures = _matcher->getRankFeatures(_request, _searchCtx, _attrCtx, _sessionMgr);
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index 596635a416a..87c0283d228 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -224,7 +224,7 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl
!_rankSetup->getSecondPhaseRank().empty(), !willNotNeedRanking(request, groupingContext));
ResultProcessor rp(attrContext, metaStore, sessionMgr, groupingContext, sessionId,
- request.sortSpec, params.offset, params.hits, request.should_drop_sort_data());
+ request.sortSpec, params.offset, params.hits);
size_t numThreadsPerSearch = computeNumThreadsPerSearch(mtf->estimate(), rankProperties);
LimitedThreadBundleWrapper limitedThreadBundle(threadBundle, numThreadsPerSearch);
diff --git a/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp b/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp
index dedda1504a5..445aab310d9 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/result_processor.cpp
@@ -61,8 +61,7 @@ ResultProcessor::ResultProcessor(IAttributeContext &attrContext,
GroupingContext &groupingContext,
const vespalib::string &sessionId,
const vespalib::string &sortSpec,
- size_t offset, size_t hits,
- bool drop_sort_data)
+ size_t offset, size_t hits)
: _attrContext(attrContext),
_metaStore(metaStore),
_sessionMgr(sessionMgr),
@@ -71,7 +70,6 @@ ResultProcessor::ResultProcessor(IAttributeContext &attrContext,
_sortSpec(sortSpec),
_offset(offset),
_hits(hits),
- _drop_sort_data(drop_sort_data),
_wasMerged(false)
{
if (!_groupingContext.empty()) {
@@ -140,7 +138,7 @@ ResultProcessor::makeReply(PartialResultUP full_result)
dst.metric = src._rankValue;
LOG(debug, "convertLidToGid: hit[%zu]: lid(%u) -> gid(%s)", i, docId, dst.gid.toString().c_str());
}
- if (result.hasSortData() && (hitcnt > 0) && !_drop_sort_data) {
+ if (result.hasSortData() && (hitcnt > 0)) {
size_t sortDataSize = result.sortDataSize();
for (size_t i = 0; i < hitOffset; ++i) {
sortDataSize -= result.sortData(i).second;
diff --git a/searchcore/src/vespa/searchcore/proton/matching/result_processor.h b/searchcore/src/vespa/searchcore/proton/matching/result_processor.h
index 41c764d247b..48a8aecebe1 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/result_processor.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/result_processor.h
@@ -88,7 +88,6 @@ private:
const vespalib::string &_sortSpec;
size_t _offset;
size_t _hits;
- bool _drop_sort_data;
bool _wasMerged;
public:
@@ -98,8 +97,7 @@ public:
GroupingContext & groupingContext,
const vespalib::string & sessionId,
const vespalib::string & sortSpec,
- size_t offset, size_t hits,
- bool drop_sort_data);
+ size_t offset, size_t hits);
~ResultProcessor();
size_t countFS4Hits();
diff --git a/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp b/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp
index e38820b6e8b..7526326b6ca 100644
--- a/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp
+++ b/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp
@@ -2,7 +2,6 @@
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/searchlib/engine/proto_converter.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/data/slime/binary_format.h>
@@ -343,14 +342,14 @@ TEST_F(DocsumRequestTest, require_that_cache_query_is_converted) {
proto.set_cache_query(true);
convert();
EXPECT_TRUE(request.propertiesMap.cacheProperties().lookup("query").found());
- EXPECT_FALSE((request.queryFlags & search::fs4transport::QFLAG_DUMP_FEATURES) != 0);
+ EXPECT_FALSE(request.dumpFeatures);
}
TEST_F(DocsumRequestTest, require_that_dump_features_is_converted) {
proto.set_dump_features(true);
convert();
EXPECT_FALSE(request.propertiesMap.cacheProperties().lookup("query").found());
- EXPECT_TRUE((request.queryFlags & search::fs4transport::QFLAG_DUMP_FEATURES) != 0);
+ EXPECT_TRUE(request.dumpFeatures);
}
TEST_F(DocsumRequestTest, require_that_rank_profile_is_converted) {
diff --git a/searchlib/src/vespa/searchlib/common/transport.h b/searchlib/src/vespa/searchlib/common/transport.h
deleted file mode 100644
index 301acde7bd6..00000000000
--- a/searchlib/src/vespa/searchlib/common/transport.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#pragma once
-
-#include <cstdint>
-
-namespace search::fs4transport {
-
-/**
- * Instead of using a 32-bit number to send the 'usehardware' flag, we
- * now use this 32-bit number to send 32 flags. The currently defined flags
- * are as follows:
- * <ul>
- * <li><b>QFLAG_EXTENDED_COVERAGE</b>: Indicates that the it is able to receive extended coverage information.</li>
- * <li><b>QFLAG_COVERAGE_NODES</b>: Indicate that it is able to handle nodes information.</li>
- * <li><b>QFLAG_ESTIMATE</b>: Indicates that the query is performed to get
- * an estimate of the total number of hits</li>
- * <li><b>QFLAG_DUMP_FEATURES</b>: Dump detailed ranking information. Note that
- * this flag will only be considered when sent in a
- * GETDOCSUMSX packet. Is is put here to avoid having
- * 2 separate query related flag spaces</li>
- * <li><b>QFLAG_DROP_SORTDATA</b>: Don't return any sort data even if sortspec
- * is used.</li>
- * <li><b>QFLAG_NO_RESULTCACHE</b>: Do not use any result cache. Perform query no matter what.</li>
- * </ul>
- **/
-enum queryflags {
- QFLAG_DROP_SORTDATA = 0x00004000,
- QFLAG_DUMP_FEATURES = 0x00040000
-};
-
-// docsum class for slime tunneling
-const uint32_t SLIME_MAGIC_ID = 0x55555555;
-
-}
diff --git a/searchlib/src/vespa/searchlib/engine/proto_converter.cpp b/searchlib/src/vespa/searchlib/engine/proto_converter.cpp
index 1736cf1f72a..2495a6e12bd 100644
--- a/searchlib/src/vespa/searchlib/engine/proto_converter.cpp
+++ b/searchlib/src/vespa/searchlib/engine/proto_converter.cpp
@@ -5,7 +5,6 @@
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/data/slime/binary_format.h>
#include <vespa/vespalib/data/smart_buffer.h>
-#include <vespa/searchlib/common/transport.h>
namespace search::engine {
@@ -119,9 +118,7 @@ ProtoConverter::docsum_request_from_proto(const ProtoDocsumRequest &proto, Docsu
if (proto.cache_query()) {
request.propertiesMap.lookupCreate(MapNames::CACHES).add("query", "true");
}
- if (proto.dump_features()) {
- request.queryFlags |= fs4transport::QFLAG_DUMP_FEATURES;
- }
+ request.dumpFeatures = proto.dump_features();
request.ranking = proto.rank_profile();
if ((proto.feature_overrides_size() + proto.tensor_feature_overrides_size()) > 0) {
auto &feature_overrides = request.propertiesMap.lookupCreate(MapNames::FEATURE);
diff --git a/searchlib/src/vespa/searchlib/engine/request.cpp b/searchlib/src/vespa/searchlib/engine/request.cpp
index 956653d5269..84615105579 100644
--- a/searchlib/src/vespa/searchlib/engine/request.cpp
+++ b/searchlib/src/vespa/searchlib/engine/request.cpp
@@ -1,14 +1,13 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "request.h"
-#include <vespa/searchlib/common/transport.h>
namespace search::engine {
Request::Request(RelativeTime relativeTime)
: _relativeTime(std::move(relativeTime)),
_timeOfDoom(fastos::TimeStamp(fastos::TimeStamp::FUTURE)),
- queryFlags(0),
+ dumpFeatures(false),
ranking(),
location(),
propertiesMap(),
@@ -35,10 +34,4 @@ fastos::TimeStamp Request::getTimeLeft() const
return _timeOfDoom - _relativeTime.now();
}
-bool
-Request::should_drop_sort_data() const
-{
- return ((queryFlags & fs4transport::QFLAG_DROP_SORTDATA) != 0);
-}
-
}
diff --git a/searchlib/src/vespa/searchlib/engine/request.h b/searchlib/src/vespa/searchlib/engine/request.h
index f5f24b6743f..a021ec6bfaa 100644
--- a/searchlib/src/vespa/searchlib/engine/request.h
+++ b/searchlib/src/vespa/searchlib/engine/request.h
@@ -28,8 +28,6 @@ public:
return vespalib::stringref(&stackDump[0], stackDump.size());
}
- bool should_drop_sort_data() const;
-
void setTraceLevel(uint32_t level, uint32_t minLevel) const {
_trace.setLevel(level);
_trace.start(minLevel);
@@ -43,7 +41,7 @@ private:
fastos::TimeStamp _timeOfDoom;
public:
/// Everything here should move up to private section and have accessors
- uint32_t queryFlags;
+ bool dumpFeatures;
vespalib::string ranking;
vespalib::string location;
PropertiesMap propertiesMap;
diff --git a/searchsummary/src/tests/docsummary/slime_summary/slime_summary_test.cpp b/searchsummary/src/tests/docsummary/slime_summary/slime_summary_test.cpp
index efeb066135f..c0d9ec2de3a 100644
--- a/searchsummary/src/tests/docsummary/slime_summary/slime_summary_test.cpp
+++ b/searchsummary/src/tests/docsummary/slime_summary/slime_summary_test.cpp
@@ -4,7 +4,6 @@
#include <vespa/searchsummary/docsummary/docsumwriter.h>
#include <vespa/searchsummary/docsummary/resultpacker.h>
#include <vespa/searchsummary/docsummary/docsumstate.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
@@ -43,7 +42,7 @@ struct DocsumFixture : IDocsumStore, GetDocsumsStateCallback {
ASSERT_GREATER(buf.GetUsedLen(), sizeof(classId));
memcpy(&classId, buf.GetDrainPos(), sizeof(classId));
buf.Drain(sizeof(classId));
- EXPECT_EQUAL(classId, ::search::fs4transport::SLIME_MAGIC_ID);
+ EXPECT_EQUAL(classId, SLIME_MAGIC_ID);
EXPECT_GREATER(vespalib::slime::BinaryFormat
::decode(Memory(buf.GetDrainPos(), buf.GetUsedLen()), slime), 0u);
}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
index 4e3540fb573..0e647b43e78 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
@@ -4,7 +4,6 @@
#include "docsumstate.h"
#include "docsum_field_writer_state.h"
#include <vespa/searchcommon/common/undefinedvalues.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
#include <vespa/searchlib/attribute/iattributemanager.h>
#include <vespa/vespalib/data/slime/slime.h>
@@ -20,7 +19,7 @@ uint32_t
IDocsumWriter::slime2RawBuf(const Slime & slime, RawBuf & buf)
{
const uint32_t preUsed = buf.GetUsedLen();
- const uint32_t magic = ::search::fs4transport::SLIME_MAGIC_ID;
+ const uint32_t magic = SLIME_MAGIC_ID;
buf.append(&magic, sizeof(magic));
SlimeOutputRawBufAdapter adapter(buf);
vespalib::slime::BinaryFormat::encode(slime, adapter);
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h
index 92b26d5cf14..e5dd2793089 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h
@@ -16,6 +16,8 @@ using search::IAttributeManager;
namespace search::docsummary {
+static constexpr uint32_t SLIME_MAGIC_ID = 0x55555555;
+
class IDocsumWriter
{
public:
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp
index 0029a57581c..8f8166a2806 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp
@@ -1,14 +1,13 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "getdocsumargs.h"
-#include "resultconfig.h"
namespace search::docsummary {
GetDocsumArgs::GetDocsumArgs()
: _ranking(),
- _qflags(0),
_resultClassName(),
+ _dumpFeatures(false),
_stackItems(0),
_stackDump(),
_location(),
@@ -35,7 +34,7 @@ void
GetDocsumArgs::initFromDocsumRequest(const search::engine::DocsumRequest &req)
{
_ranking = req.ranking;
- _qflags = req.queryFlags;
+ _dumpFeatures = req.dumpFeatures;
_resultClassName = req.resultClassName;
_stackItems = req.stackItems;
_stackDump = req.stackDump;
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h
index f0574e0d21c..ce5dc695f08 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h
@@ -15,8 +15,8 @@ public:
private:
vespalib::string _ranking;
- uint32_t _qflags;
vespalib::string _resultClassName;
+ bool _dumpFeatures;
uint32_t _stackItems;
std::vector<char> _stackDump;
vespalib::string _location;
@@ -29,7 +29,6 @@ public:
void initFromDocsumRequest(const search::engine::DocsumRequest &req);
void SetRankProfile(const vespalib::string &ranking) { _ranking = ranking; }
- void SetQueryFlags(uint32_t qflags) { _qflags = qflags; }
void setResultClassName(vespalib::stringref name) { _resultClassName = name; }
void SetStackDump(uint32_t stackItems, uint32_t stackDumpLen, const char *stackDump);
void setLocation(vespalib::stringref location) {
@@ -45,7 +44,8 @@ public:
return vespalib::stringref(&_stackDump[0], _stackDump.size());
}
- uint32_t GetQueryFlags() const { return _qflags; }
+ void dumpFeatures(bool v) { _dumpFeatures = v; }
+ bool dumpFeatures() const { return _dumpFeatures; }
const PropsMap &propertiesMap() const { return _propertiesMap; }
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
index a1f1d41f87a..63972ca139d 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
@@ -9,7 +9,6 @@
#include <vespa/document/datatype/mapdatatype.h>
#include <vespa/searchlib/aggregation/modifiers.h>
#include <vespa/searchlib/common/packets.h>
-#include <vespa/searchlib/common/transport.h>
#include <vespa/searchlib/uca/ucaconverter.h>
#include <vespa/searchlib/features/setup.h>
#include <vespa/vespalib/geo/zcurve.h>
@@ -51,6 +50,11 @@ ForceWordfolderInit::ForceWordfolderInit()
static ForceWordfolderInit _G_forceNormWordFolderInit;
+// Leftovers from FS4 protocol with limited use here.
+enum queryflags {
+ QFLAG_DUMP_FEATURES = 0x00040000
+};
+
AttributeVector::SP
createMultiValueAttribute(const vespalib::string & name, const document::FieldValue & fv, bool arrayType)
@@ -223,11 +227,11 @@ void SearchVisitor::init(const Parameters & params)
LOG(debug, "Received rank profile: %s", _rankController.getRankProfile().c_str());
}
- if (params.lookup("queryflags", valueRef) ) {
- vespalib::string tmp(valueRef.data(), valueRef.size());
- LOG(debug, "Received query flags: 0x%lx", strtoul(tmp.c_str(), nullptr, 0));
- uint32_t queryFlags = strtoul(tmp.c_str(), nullptr, 0);
- _rankController.setDumpFeatures((queryFlags & search::fs4transport::QFLAG_DUMP_FEATURES) != 0);
+ int queryFlags = 0;
+ if (params.get("queryflags", queryFlags)) {
+ bool dumpFeatures = (queryFlags & QFLAG_DUMP_FEATURES) != 0;
+ _summaryGenerator.getDocsumState()._args.dumpFeatures(dumpFeatures);
+ _rankController.setDumpFeatures(dumpFeatures);
LOG(debug, "QFLAG_DUMP_FEATURES: %s", _rankController.getDumpFeatures() ? "true" : "false");
}
@@ -263,11 +267,6 @@ void SearchVisitor::init(const Parameters & params)
_summaryGenerator.getDocsumState()._args.SetRankProfile(tmp);
}
- int queryFlags = 0;
- if (params.get("queryflags", queryFlags)) {
- _summaryGenerator.getDocsumState()._args.SetQueryFlags(queryFlags);
- }
-
vespalib::string location;
if (params.lookup("location", valueRef)) {
location = vespalib::string(valueRef.data(), valueRef.size());