summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java14
-rw-r--r--searchcore/src/tests/proton/summaryengine/summaryengine.cpp231
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/summaryengine/isearchhandler.h4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/reference_attribute.h7
-rw-r--r--searchlib/src/vespa/searchlib/datastore/allocator.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/allocator.hpp5
-rw-r--r--searchlib/src/vespa/searchlib/datastore/array_store.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/array_store.hpp5
-rw-r--r--searchlib/src/vespa/searchlib/datastore/array_store_config.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/buffer_type.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/datastore/buffer_type.h7
-rw-r--r--searchlib/src/vespa/searchlib/datastore/bufferstate.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/datastore/bufferstate.h8
-rw-r--r--searchlib/src/vespa/searchlib/datastore/datastore.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/datastore/datastore.h11
-rw-r--r--searchlib/src/vespa/searchlib/datastore/datastore.hpp6
-rw-r--r--searchlib/src/vespa/searchlib/datastore/datastorebase.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/datastore/datastorebase.h7
-rw-r--r--searchlib/src/vespa/searchlib/datastore/entryref.h9
-rw-r--r--searchlib/src/vespa/searchlib/datastore/free_list_allocator.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/free_list_allocator.hpp5
-rw-r--r--searchlib/src/vespa/searchlib/datastore/handle.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/i_compaction_context.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/raw_allocator.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/raw_allocator.hpp5
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store.hpp4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store_builder.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store_builder.hpp5
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store_saver.h4
-rw-r--r--searchlib/src/vespa/searchlib/datastore/unique_store_saver.hpp4
-rw-r--r--searchlib/src/vespa/searchlib/engine/docsumapi.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/engine/docsumapi.h7
-rw-r--r--searchlib/src/vespa/searchlib/engine/docsumrequest.h10
-rw-r--r--searchlib/src/vespa/searchlib/engine/propertiesmap.h27
-rw-r--r--searchlib/src/vespa/searchlib/engine/request.h10
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/CMakeLists.txt1
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.cpp16
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.h14
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp101
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumformat.h67
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumstore.h6
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumstorevalue.h5
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp9
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h19
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/dynamicteaserdfw.cpp3
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp4
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h5
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/idocsumenvironment.h5
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.cpp11
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.h19
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp8
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h5
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.cpp7
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.h7
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.cpp14
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.h20
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp4
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/resultclass.h8
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp6
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h11
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/resultpacker.cpp11
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/resultpacker.h9
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.cpp7
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.h6
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.cpp39
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.h25
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp16
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.cpp7
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.h20
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/tokenizer.cpp4
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/tokenizer.h7
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/urlresult.h12
76 files changed, 291 insertions, 728 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java b/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java
index fb003463dba..47558b131a0 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/Dispatcher.java
@@ -14,6 +14,7 @@ import com.yahoo.prelude.fastsearch.FastHit;
import com.yahoo.prelude.fastsearch.TimeoutException;
import com.yahoo.search.Query;
import com.yahoo.search.Result;
+import com.yahoo.search.query.SessionId;
import com.yahoo.search.result.ErrorMessage;
import com.yahoo.search.result.Hit;
import com.yahoo.slime.BinaryFormat;
@@ -115,19 +116,26 @@ public class Dispatcher extends AbstractComponent {
return;
}
- byte[] serializedSlime = BinaryFormat.encode(toSlime(summaryClass, hits));
- double timeoutSeconds = ((double)result.getQuery().getTimeLeft()-3.0)/1000.0;
+ Query query = result.getQuery();
+ byte[] serializedSlime = BinaryFormat.encode(toSlime(query.getRanking().getProfile(), summaryClass, query.getSessionId(false), hits));
+ double timeoutSeconds = ((double)query.getTimeLeft()-3.0)/1000.0;
Compressor.Compression compressionResult = compressor.compress(compression, serializedSlime);
client.getDocsums(hits, node, compressionResult.type(),
serializedSlime.length, compressionResult.data(), responseReceiver, timeoutSeconds);
}
- public Slime toSlime(String summaryClass, List<FastHit> hits) {
+ static private Slime toSlime(String rankProfile, String summaryClass, SessionId sessionId, List<FastHit> hits) {
Slime slime = new Slime();
Cursor root = slime.setObject();
if (summaryClass != null) {
root.setString("class", summaryClass);
}
+ if (sessionId != null) {
+ root.setData("sessionid", sessionId.asUtf8String().getBytes());
+ }
+ if (rankProfile != null) {
+ root.setString("ranking", rankProfile);
+ }
Cursor gids = root.setArray("gids");
for (FastHit hit : hits) {
gids.addData(hit.getGlobalId().getRawId());
diff --git a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
index 3262d571c56..a17c19804c5 100644
--- a/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
+++ b/searchcore/src/tests/proton/summaryengine/summaryengine.cpp
@@ -2,11 +2,9 @@
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchcore/proton/summaryengine/summaryengine.h>
#include <vespa/searchcore/proton/summaryengine/docsum_by_slime.h>
-#include <vespa/searchlib/engine/docsumapi.h>
#include <vespa/searchlib/engine/searchreply.h>
#include <vespa/searchlib/util/rawbuf.h>
#include <vespa/searchlib/util/slime_output_raw_buf_adapter.h>
-#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/data/databuffer.h>
#include <vespa/document/util/compressor.h>
#include <vespa/searchlib/common/transport.h>
@@ -35,30 +33,33 @@ class MySearchHandler : public ISearchHandler {
std::string _name;
stringref _reply;
public:
- MySearchHandler(const std::string & name = "my",
- const stringref & reply = MYREPLY) :
- _name(name), _reply(reply) {}
- virtual DocsumReply::UP getDocsums(const DocsumRequest & request) override {
+ MySearchHandler(const std::string &name = "my", const stringref &reply = MYREPLY)
+ : _name(name), _reply(reply)
+ {}
+
+ virtual DocsumReply::UP getDocsums(const DocsumRequest &request) override {
return (request.useRootSlime())
- ? std::make_unique<DocsumReply>(createSlimeReply(request.hits.size()))
- : createOldDocSum(request);
+ ? std::make_unique<DocsumReply>(createSlimeReply(request.hits.size()))
+ : createOldDocSum(request);
}
- vespalib::Slime::UP createSlimeReply(size_t count) {
+
+ vespalib::Slime::UP createSlimeReply(size_t count) {
vespalib::Slime::UP response(std::make_unique<vespalib::Slime>());
- Cursor & root = response->setObject();
- Cursor & array = root.setArray(DOCSUMS);
+ Cursor &root = response->setObject();
+ Cursor &array = root.setArray(DOCSUMS);
const Symbol docsumSym = response->insert(DOCSUM);
- for (size_t i=0; i < count; i++) {
- Cursor & docSumC = array.addObject();
+ for (size_t i = 0; i < count; i++) {
+ Cursor &docSumC = array.addObject();
ObjectSymbolInserter inserter(docSumC, docsumSym);
inserter.insertObject().setLong("long", 982);
}
return response;
}
- DocsumReply::UP createOldDocSum(const DocsumRequest & request) {
+
+ DocsumReply::UP createOldDocSum(const DocsumRequest &request) {
DocsumReply::UP retval(new DocsumReply());
- for (size_t i=0; i < request.hits.size(); i++) {
- const DocsumRequest::Hit & h = request.hits[i];
+ for (size_t i = 0; i < request.hits.size(); i++) {
+ const DocsumRequest::Hit &h = request.hits[i];
DocsumReply::Docsum docsum;
docsum.docid = 10 + i;
docsum.gid = h.gid;
@@ -79,11 +80,13 @@ public:
class MyDocsumClient : public DocsumClient {
private:
vespalib::Monitor _monitor;
- DocsumReply::UP _reply;
+ DocsumReply::UP _reply;
public:
MyDocsumClient();
+
~MyDocsumClient();
+
void getDocsumsDone(DocsumReply::UP reply) override {
vespalib::MonitorGuard guard(_monitor);
_reply = std::move(reply);
@@ -101,42 +104,24 @@ public:
};
MyDocsumClient::MyDocsumClient() {}
-MyDocsumClient::~MyDocsumClient() {}
-class Test : public vespalib::TestApp {
-private:
- bool assertDocsumReply(SummaryEngine & engine,
- const std::string & searchDocType,
- const stringref & expReply);
-
- void requireThatGetDocsumsExecute();
- void requireThatHandlersAreStored();
- void requireThatCorrectHandlerIsUsed();
- void requireThatSlimeRequestIsConvertedCorrectly();
- void requireThatSlimeInterfaceWorksFine();
- void requireThatRPCInterfaceWorks();
-public:
- int Main() override;
-};
+MyDocsumClient::~MyDocsumClient() {}
DocsumRequest::UP
-createRequest(size_t num=1)
-{
+createRequest(size_t num = 1) {
DocsumRequest::UP r(new DocsumRequest());
if (num == 1) {
r->hits.emplace_back(GlobalId("aaaaaaaaaaaa"));
} else {
- for (size_t i=0; i < num; i++) {
- vespalib::string s = vespalib::make_string("aaaaaaaaaaa%c", char('a' + i%26));
+ for (size_t i = 0; i < num; i++) {
+ vespalib::string s = vespalib::make_string("aaaaaaaaaaa%c", char('a' + i % 26));
r->hits.push_back(GlobalId(s.c_str()));
}
}
return r;
}
-void
-Test::requireThatGetDocsumsExecute()
-{
+TEST("requireThatGetDocsumsExecute") {
int numSummaryThreads = 2;
SummaryEngine engine(numSummaryThreads);
ISearchHandler::SP handler(new MySearchHandler);
@@ -163,9 +148,7 @@ Test::requireThatGetDocsumsExecute()
}
}
-void
-Test::requireThatHandlersAreStored()
-{
+TEST("requireThatHandlersAreStored") {
DocTypeName dtnvfoo("foo");
DocTypeName dtnvbar("bar");
int numSummaryThreads = 2;
@@ -190,19 +173,17 @@ Test::requireThatHandlersAreStored()
}
bool
-Test::assertDocsumReply(SummaryEngine & engine, const std::string & searchDocType, const stringref & expReply)
-{
+assertDocsumReply(SummaryEngine &engine, const std::string &searchDocType, const stringref &expReply) {
DocsumRequest::UP request(createRequest());
request->propertiesMap.lookupCreate(search::MapNames::MATCH).add("documentdb.searchdoctype", searchDocType);
MyDocsumClient client;
engine.getDocsums(DocsumRequest::Source(std::move(request)), client);
DocsumReply::UP reply = client.getReply(10000);
- return EXPECT_EQUAL(vespalib::stringref(expReply), vespalib::stringref(reply->docsums[0].data.c_str(), reply->docsums[0].data.size()));
+ return EXPECT_EQUAL(vespalib::stringref(expReply),
+ vespalib::stringref(reply->docsums[0].data.c_str(), reply->docsums[0].data.size()));
}
-void
-Test::requireThatCorrectHandlerIsUsed()
-{
+TEST("requireThatCorrectHandlerIsUsed") {
DocTypeName dtnvfoo("foo");
DocTypeName dtnvbar("bar");
DocTypeName dtnvbaz("baz");
@@ -226,8 +207,7 @@ const char *GID1 = "abcdefghijkl";
const char *GID2 = "bcdefghijklm";
void
-verify(vespalib::stringref exp, const Slime & slime)
-{
+verify(vespalib::stringref exp, const Slime &slime) {
Memory expMemory(exp);
vespalib::Slime expSlime;
size_t used = vespalib::slime::JsonFormat::decode(expMemory, expSlime);
@@ -241,12 +221,19 @@ verify(vespalib::stringref exp, const Slime & slime)
}
Slime
-createSlimeRequestLarger(size_t num)
-{
+createSlimeRequestLarger(size_t num,
+ const vespalib::string & sessionId = vespalib::string(),
+ const vespalib::string & ranking = vespalib::string()) {
Slime r;
- Cursor & root = r.setObject();
+ Cursor &root = r.setObject();
root.setString("class", "your-summary");
- Cursor & array = root.setArray("gids");
+ if ( ! sessionId.empty()) {
+ root.setData("sessionid", sessionId);
+ }
+ if (!ranking.empty()) {
+ root.setString("ranking", ranking);
+ }
+ Cursor &array = root.setArray("gids");
for (size_t i(0); i < num; i++) {
array.addData(Memory(GID1, 12));
array.addData(Memory(GID2, 12));
@@ -255,14 +242,12 @@ createSlimeRequestLarger(size_t num)
}
Slime
-createSlimeRequest()
-{
- return createSlimeRequestLarger(1);
+createSlimeRequest(const vespalib::string & sessionId = vespalib::string(),
+ const vespalib::string & ranking = vespalib::string()) {
+ return createSlimeRequestLarger(1, sessionId, ranking);
}
-void
-Test::requireThatSlimeRequestIsConvertedCorrectly()
-{
+TEST("requireThatSlimeRequestIsConvertedCorrectly") {
vespalib::Slime slimeRequest = createSlimeRequest();
TEST_DO(verify("{"
" class: 'your-summary',"
@@ -273,14 +258,38 @@ Test::requireThatSlimeRequestIsConvertedCorrectly()
"}", slimeRequest));
DocsumRequest::UP r = DocsumBySlime::slimeToRequest(slimeRequest.get());
EXPECT_EQUAL("your-summary", r->resultClassName);
+ EXPECT_FALSE(r->propertiesMap.cacheProperties().lookup("query").found());
+ EXPECT_TRUE(r->sessionId.empty());
+ EXPECT_TRUE(r->ranking.empty());
+ EXPECT_EQUAL(2u, r->hits.size());
+ EXPECT_EQUAL(GlobalId(GID1), r->hits[0].gid);
+ EXPECT_EQUAL(GlobalId(GID2), r->hits[1].gid);
+}
+
+TEST("require that presence of sessionid affect both request.sessionid and enables cache") {
+ vespalib::Slime slimeRequest = createSlimeRequest("1.some.key.7", "my-rank-profile");
+ TEST_DO(verify("{"
+ " class: 'your-summary',"
+ " sessionid: '0x312E736F6D652E6B65792E37',"
+ " ranking: 'my-rank-profile',"
+ " gids: ["
+ " '0x6162636465666768696A6B6C',"
+ " '0x62636465666768696A6B6C6D'"
+ " ]"
+ "}", slimeRequest));
+ DocsumRequest::UP r = DocsumBySlime::slimeToRequest(slimeRequest.get());
+ EXPECT_EQUAL("your-summary", r->resultClassName);
+ EXPECT_EQUAL("my-rank-profile", r->ranking);
+
+ EXPECT_EQUAL(0, strncmp("1.some.key.7", &r->sessionId[0],r->sessionId.size()));
+ EXPECT_TRUE(r->propertiesMap.cacheProperties().lookup("query").found());
EXPECT_EQUAL(2u, r->hits.size());
EXPECT_EQUAL(GlobalId(GID1), r->hits[0].gid);
EXPECT_EQUAL(GlobalId(GID2), r->hits[1].gid);
}
void
-createSummary(search::RawBuf & buf)
-{
+createSummary(search::RawBuf &buf) {
vespalib::Slime summary;
summary.setObject().setLong("long", 982);
uint32_t magic = search::fs4transport::SLIME_MAGIC_ID;
@@ -289,27 +298,28 @@ createSummary(search::RawBuf & buf)
BinaryFormat::encode(summary, adapter);
}
-class BaseServer
-{
+class BaseServer {
protected:
- BaseServer() :
- buf(100)
+ BaseServer() : buf(100)
{
createSummary(buf);
}
+
protected:
- search::RawBuf buf;
+ search::RawBuf buf;
};
+
class Server : public BaseServer {
public:
Server();
~Server();
+
private:
- SummaryEngine engine;
- ISearchHandler::SP handler;
+ SummaryEngine engine;
+ ISearchHandler::SP handler;
public:
- DocsumBySlime docsumBySlime;
- DocsumByRPC docsumByRPC;
+ DocsumBySlime docsumBySlime;
+ DocsumByRPC docsumByRPC;
};
Server::Server()
@@ -322,36 +332,31 @@ Server::Server()
DocTypeName dtnvfoo("foo");
engine.putSearchHandler(dtnvfoo, handler);
}
+
Server::~Server() {}
vespalib::string
-getAnswer(size_t num)
-{
- vespalib::string s =
- "{"
- " docsums: [";
- for (size_t i(1); i < num*2; i++) {
- s +=
- " {"
- " docsum: {"
- " long: 982"
- " }"
- " },";
+getAnswer(size_t num) {
+ vespalib::string s;
+ s += "{ docsums: [";
+ for (size_t i(1); i < num * 2; i++) {
+ s += " {"
+ " docsum: {"
+ " long: 982"
+ " }"
+ " },";
}
- s +=
- " {"
- " docsum: {"
- " long: 982"
- " }"
- " }"
- " ]";
- s += "}";
+ s += " {"
+ " docsum: {"
+ " long: 982"
+ " }"
+ " }"
+ " ]";
+ s += "}";
return s;
}
-void
-Test::requireThatSlimeInterfaceWorksFine()
-{
+TEST("requireThatSlimeInterfaceWorksFine") {
Server server;
vespalib::Slime slimeRequest = createSlimeRequest();
vespalib::Slime::UP response = server.docsumBySlime.getDocsums(slimeRequest.get());
@@ -372,8 +377,8 @@ Test::requireThatSlimeInterfaceWorksFine()
}
void
-verifyReply(size_t count, document::CompressionConfig::Type encoding, size_t orgSize, size_t compressedSize, FRT_RPCRequest * request)
-{
+verifyReply(size_t count, document::CompressionConfig::Type encoding, size_t orgSize, size_t compressedSize,
+ FRT_RPCRequest *request) {
FRT_Values &ret = *request->GetReturn();
EXPECT_EQUAL(encoding, ret[0]._intval8);
EXPECT_EQUAL(orgSize, ret[1]._intval32);
@@ -392,20 +397,20 @@ verifyReply(size_t count, document::CompressionConfig::Type encoding, size_t org
void
verifyRPC(size_t count,
document::CompressionConfig::Type requestCompression, size_t requestSize, size_t requestBlobSize,
- document::CompressionConfig::Type replyCompression, size_t replySize, size_t replyBlobSize)
-{
+ document::CompressionConfig::Type replyCompression, size_t replySize, size_t replyBlobSize) {
Server server;
vespalib::Slime slimeRequest = createSlimeRequestLarger(count);
- vespalib::SimpleBuffer buf;
+ vespalib::SimpleBuffer buf;
BinaryFormat::encode(slimeRequest, buf);
EXPECT_EQUAL(requestSize, buf.get().size);
CompressionConfig config(requestCompression, 9, 100);
DataBuffer compressed(const_cast<char *>(buf.get().data), buf.get().size);
- CompressionConfig::Type type = compression::compress(config, ConstBufferRef(buf.get().data, buf.get().size), compressed, true);
+ CompressionConfig::Type type = compression::compress(config, ConstBufferRef(buf.get().data, buf.get().size),
+ compressed, true);
EXPECT_EQUAL(type, requestCompression);
- FRT_RPCRequest * request = new FRT_RPCRequest();
+ FRT_RPCRequest *request = new FRT_RPCRequest();
FRT_Values &arg = *request->GetParams();
arg.AddInt8(type);
arg.AddInt32(buf.get().size);
@@ -418,30 +423,12 @@ verifyRPC(size_t count,
request->SubRef();
}
-void
-Test::requireThatRPCInterfaceWorks()
-{
+TEST("requireThatRPCInterfaceWorks") {
verifyRPC(1, document::CompressionConfig::NONE, 55, 55, document::CompressionConfig::NONE, 38, 38);
verifyRPC(100, document::CompressionConfig::NONE, 2631, 2631, document::CompressionConfig::LZ4, 1426, 46);
verifyRPC(100, document::CompressionConfig::LZ4, 2631, 69, document::CompressionConfig::LZ4, 1426, 46);
}
-int
-Test::Main()
-{
- TEST_INIT("summaryengine_test");
-
- requireThatGetDocsumsExecute();
- requireThatHandlersAreStored();
- requireThatCorrectHandlerIsUsed();
- requireThatSlimeRequestIsConvertedCorrectly();
- requireThatSlimeInterfaceWorksFine();
- requireThatRPCInterfaceWorks();
-
- TEST_DONE();
}
-}
-
-TEST_APPHOOK(proton::Test);
-
+TEST_MAIN() { TEST_RUN_ALL(); }
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
index 8e252d9fcb4..df93d4cd1ff 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp
@@ -148,8 +148,7 @@ DocsumContext::FillSummaryFeatures(search::docsummary::GetDocsumsState * state,
{
assert(&_docsumState == state);
if (_matcher->canProduceSummaryFeatures()) {
- state->_summaryFeatures =
- _matcher->getSummaryFeatures(_request, _searchCtx, _attrCtx, _sessionMgr);
+ state->_summaryFeatures = _matcher->getSummaryFeatures(_request, _searchCtx, _attrCtx, _sessionMgr);
}
state->_summaryFeaturesCached = false;
}
@@ -162,8 +161,7 @@ DocsumContext::FillRankFeatures(search::docsummary::GetDocsumsState * state, sea
if ((state->_args.GetQueryFlags() & search::fs4transport::QFLAG_DUMP_FEATURES) == 0) {
return;
}
- state->_rankFeatures =
- _matcher->getRankFeatures(_request, _searchCtx, _attrCtx, _sessionMgr);
+ state->_rankFeatures = _matcher->getRankFeatures(_request, _searchCtx, _attrCtx, _sessionMgr);
}
namespace {
diff --git a/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp b/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp
index 8dcd1381b20..9a37e0ae495 100644
--- a/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp
+++ b/searchcore/src/vespa/searchcore/proton/summaryengine/docsum_by_slime.cpp
@@ -27,6 +27,8 @@ using document::CompressionConfig;
namespace {
+Memory SESSIONID("sessionid");
+Memory RANKING("ranking");
Memory SUMMARYCLASS("class");
Memory GIDS("gids");
Memory DOCSUM("docsum");
@@ -62,6 +64,13 @@ DocsumBySlime::slimeToRequest(const Inspector & request)
DocsumRequest::UP docsumRequest(std::make_unique<DocsumRequest>(true));
docsumRequest->resultClassName = request[SUMMARYCLASS].asString().make_string();
+ Memory m = request[SESSIONID].asData();
+ if (m.size > 0) {
+ docsumRequest->sessionId.resize(m.size);
+ memcpy(&docsumRequest->sessionId[0], m.data, m.size);
+ docsumRequest->propertiesMap.lookupCreate(search::MapNames::CACHES).add("query", "true");
+ }
+ docsumRequest->ranking = request[RANKING].asString().make_string();
Inspector & gids = request[GIDS];
docsumRequest->hits.reserve(gids.entries());
GidTraverser gidFiller(docsumRequest->hits);
diff --git a/searchcore/src/vespa/searchcore/proton/summaryengine/isearchhandler.h b/searchcore/src/vespa/searchcore/proton/summaryengine/isearchhandler.h
index 98b0368b0b5..8c61a1c39d9 100644
--- a/searchcore/src/vespa/searchcore/proton/summaryengine/isearchhandler.h
+++ b/searchcore/src/vespa/searchcore/proton/summaryengine/isearchhandler.h
@@ -3,14 +3,12 @@
#include <vespa/vespalib/util/thread_bundle.h>
-namespace search {
-namespace engine {
+namespace search::engine {
class SearchRequest;
class SearchReply;
class DocsumRequest;
class DocsumReply;
}
-}
namespace proton {
diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
index ee911c9a8cc..480a9178655 100644
--- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
@@ -11,8 +11,7 @@
#include <vespa/searchlib/common/i_gid_to_lid_mapper.h>
#include <vespa/vespalib/data/fileheader.h>
-namespace search {
-namespace attribute {
+namespace search::attribute {
namespace {
@@ -383,7 +382,7 @@ IMPLEMENT_IDENTIFIABLE_ABSTRACT(ReferenceAttribute, AttributeVector);
}
-namespace datastore {
+namespace search::datastore {
using Reference = attribute::Reference;
@@ -392,4 +391,3 @@ template class UniqueStoreBuilder<Reference, EntryRefT<22>>;
template class UniqueStoreSaver<Reference, EntryRefT<22>>;
}
-}
diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.h b/searchlib/src/vespa/searchlib/attribute/reference_attribute.h
index a751213dc9a..08bcfc2cbb8 100644
--- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.h
@@ -8,11 +8,9 @@
#include <vespa/searchlib/datastore/unique_store.h>
#include <vespa/searchlib/common/rcuvector.h>
-namespace search {
+namespace search { class IGidToLidMapperFactory; }
-class IGidToLidMapperFactory;
-
-namespace attribute {
+namespace search::attribute {
/*
* Attribute vector which maintains a lid-2-lid mapping from local document ids to global ids (referencing external documents)
@@ -87,4 +85,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/allocator.h b/searchlib/src/vespa/searchlib/datastore/allocator.h
index 8a1579771d5..8a522266c1a 100644
--- a/searchlib/src/vespa/searchlib/datastore/allocator.h
+++ b/searchlib/src/vespa/searchlib/datastore/allocator.h
@@ -7,8 +7,7 @@
#include "handle.h"
#include <vespa/vespalib/util/arrayref.h>
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Allocator used to allocate entries of a specific type in an underlying data store.
@@ -35,4 +34,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/allocator.hpp b/searchlib/src/vespa/searchlib/datastore/allocator.hpp
index b36ae131cc8..9c4f8568924 100644
--- a/searchlib/src/vespa/searchlib/datastore/allocator.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/allocator.hpp
@@ -5,8 +5,7 @@
#include "allocator.h"
#include "bufferstate.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
template <typename EntryT, typename RefT>
Allocator<EntryT, RefT>::Allocator(DataStoreBase &store, uint32_t typeId)
@@ -70,4 +69,4 @@ Allocator<EntryT, RefT>::allocArray(size_t size)
}
}
-}
+
diff --git a/searchlib/src/vespa/searchlib/datastore/array_store.h b/searchlib/src/vespa/searchlib/datastore/array_store.h
index 5ff4be682ec..c6d3fff1b85 100644
--- a/searchlib/src/vespa/searchlib/datastore/array_store.h
+++ b/searchlib/src/vespa/searchlib/datastore/array_store.h
@@ -10,8 +10,7 @@
#include "i_compaction_context.h"
#include <vespa/vespalib/util/array.h>
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Datastore for storing arrays of type EntryT that is accessed via a 32-bit EntryRef.
@@ -110,4 +109,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/array_store.hpp b/searchlib/src/vespa/searchlib/datastore/array_store.hpp
index 33156c61fa5..8478c22903f 100644
--- a/searchlib/src/vespa/searchlib/datastore/array_store.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/array_store.hpp
@@ -6,8 +6,7 @@
#include "datastore.hpp"
#include <atomic>
-namespace search {
-namespace datastore {
+namespace search::datastore {
constexpr size_t MIN_BUFFER_CLUSTERS = 8192;
@@ -199,4 +198,4 @@ ArrayStore<EntryT, RefT>::optimizedConfigForHugePage(size_t maxSmallArraySize,
}
}
-}
+
diff --git a/searchlib/src/vespa/searchlib/datastore/array_store_config.h b/searchlib/src/vespa/searchlib/datastore/array_store_config.h
index a638541f97e..849ca53f35c 100644
--- a/searchlib/src/vespa/searchlib/datastore/array_store_config.h
+++ b/searchlib/src/vespa/searchlib/datastore/array_store_config.h
@@ -5,8 +5,7 @@
#include <cstddef>
#include <vector>
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Config specifying layout and buffer allocation strategy for an array store.
@@ -66,4 +65,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/buffer_type.cpp b/searchlib/src/vespa/searchlib/datastore/buffer_type.cpp
index 6023171abb5..5eca3719002 100644
--- a/searchlib/src/vespa/searchlib/datastore/buffer_type.cpp
+++ b/searchlib/src/vespa/searchlib/datastore/buffer_type.cpp
@@ -3,8 +3,7 @@
#include "buffer_type.h"
#include <algorithm>
-namespace search {
-namespace datastore {
+namespace search::datastore {
BufferTypeBase::BufferTypeBase(uint32_t clusterSize,
uint32_t minClusters,
@@ -123,6 +122,5 @@ BufferTypeBase::calcClustersToAlloc(uint32_t bufferId, size_t sizeNeeded, bool r
return wantClusters;
}
-} // namespace datastore
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/datastore/buffer_type.h b/searchlib/src/vespa/searchlib/datastore/buffer_type.h
index e41e45f54c0..92dcbcc9e8d 100644
--- a/searchlib/src/vespa/searchlib/datastore/buffer_type.h
+++ b/searchlib/src/vespa/searchlib/datastore/buffer_type.h
@@ -6,8 +6,7 @@
#include <cstdint>
#include <sys/types.h>
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Class used manage allocation and de-allocation of a specific data type in
@@ -163,6 +162,4 @@ BufferType<EntryType>::cleanHold(void *buffer, uint64_t offset, uint64_t len, Cl
}
}
-} // namespace search::datastore
-} // namespace search
-
+}
diff --git a/searchlib/src/vespa/searchlib/datastore/bufferstate.cpp b/searchlib/src/vespa/searchlib/datastore/bufferstate.cpp
index 09c7cf65bb6..cf6c59b69c4 100644
--- a/searchlib/src/vespa/searchlib/datastore/bufferstate.cpp
+++ b/searchlib/src/vespa/searchlib/datastore/bufferstate.cpp
@@ -5,8 +5,7 @@
using vespalib::alloc::Alloc;
-namespace search {
-namespace datastore {
+namespace search::datastore {
BufferState::FreeListList::~FreeListList()
{
@@ -251,6 +250,5 @@ BufferState::fallbackResize(uint32_t bufferId,
std::atomic_thread_fence(std::memory_order_release);
}
-} // namespace datastore
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/datastore/bufferstate.h b/searchlib/src/vespa/searchlib/datastore/bufferstate.h
index 5ff17d3bc81..904a5bbb16a 100644
--- a/searchlib/src/vespa/searchlib/datastore/bufferstate.h
+++ b/searchlib/src/vespa/searchlib/datastore/bufferstate.h
@@ -8,8 +8,7 @@
#include <vespa/vespalib/util/alloc.h>
#include <vespa/vespalib/util/array.h>
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Represents a memory allocated buffer (used in a data store) with its state.
@@ -182,7 +181,4 @@ public:
};
-
-} // namespace search::datastore
-} // namespace search
-
+}
diff --git a/searchlib/src/vespa/searchlib/datastore/datastore.cpp b/searchlib/src/vespa/searchlib/datastore/datastore.cpp
index 2f4e24c5d1a..5def7461e90 100644
--- a/searchlib/src/vespa/searchlib/datastore/datastore.cpp
+++ b/searchlib/src/vespa/searchlib/datastore/datastore.cpp
@@ -5,13 +5,11 @@
#include <vespa/vespalib/util/array.hpp>
#include <vespa/searchlib/common/rcuvector.hpp>
-namespace search {
-namespace datastore {
+namespace search::datastore {
template class DataStoreT<EntryRefT<22> >;
-} // namespace datastore
-} // namespace search
+}
template void vespalib::Array<search::datastore::DataStoreBase::ElemHold1ListElem>::increase(size_t);
template class search::attribute::RcuVector<search::datastore::EntryRef>;
diff --git a/searchlib/src/vespa/searchlib/datastore/datastore.h b/searchlib/src/vespa/searchlib/datastore/datastore.h
index 0e3518960ed..26826ea0408 100644
--- a/searchlib/src/vespa/searchlib/datastore/datastore.h
+++ b/searchlib/src/vespa/searchlib/datastore/datastore.h
@@ -7,8 +7,7 @@
#include "free_list_allocator.h"
#include "raw_allocator.h"
-namespace search {
-namespace btree {
+namespace search::btree {
template<typename EntryType>
struct DefaultReclaimer {
@@ -17,9 +16,9 @@ struct DefaultReclaimer {
}
};
-} // namespace btree
+}
-namespace datastore {
+namespace search::datastore {
template <typename RefT = EntryRefT<22> >
class DataStoreT : public DataStoreBase
@@ -108,6 +107,4 @@ public:
extern template class DataStoreT<EntryRefT<22> >;
-} // namespace search::datastore
-} // namespace search
-
+}
diff --git a/searchlib/src/vespa/searchlib/datastore/datastore.hpp b/searchlib/src/vespa/searchlib/datastore/datastore.hpp
index f0fc451d952..de9bd1bc161 100644
--- a/searchlib/src/vespa/searchlib/datastore/datastore.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/datastore.hpp
@@ -8,8 +8,7 @@
#include "raw_allocator.hpp"
#include <vespa/vespalib/util/array.hpp>
-namespace search {
-namespace datastore {
+namespace search::datastore {
template <typename RefT>
DataStoreT<RefT>::DataStoreT()
@@ -193,6 +192,5 @@ DataStore<EntryType, RefT>::getEntry(EntryRef ref) const
extern template class DataStoreT<EntryRefT<22> >;
-} // namespace search::datastore
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp b/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp
index 5cc1fecf798..d344c79d50e 100644
--- a/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp
+++ b/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp
@@ -5,8 +5,7 @@
using vespalib::GenerationHeldBase;
-namespace search {
-namespace datastore {
+namespace search::datastore {
namespace {
@@ -517,5 +516,5 @@ DataStoreBase::startCompactWorstBuffers(bool compactMemory, bool compactAddressS
return result;
}
-} // namespace datastore
-} // namespace search
+}
+
diff --git a/searchlib/src/vespa/searchlib/datastore/datastorebase.h b/searchlib/src/vespa/searchlib/datastore/datastorebase.h
index 5add42da919..75e1ec8fb85 100644
--- a/searchlib/src/vespa/searchlib/datastore/datastorebase.h
+++ b/searchlib/src/vespa/searchlib/datastore/datastorebase.h
@@ -9,8 +9,7 @@
#include <vector>
#include <deque>
-namespace search {
-namespace datastore {
+namespace search::datastore {
class DataStoreBase
{
@@ -345,6 +344,4 @@ public:
};
-} // namespace datastore
-} // namespace search
-
+}
diff --git a/searchlib/src/vespa/searchlib/datastore/entryref.h b/searchlib/src/vespa/searchlib/datastore/entryref.h
index 865dc3ed287..c8d7ffe8b66 100644
--- a/searchlib/src/vespa/searchlib/datastore/entryref.h
+++ b/searchlib/src/vespa/searchlib/datastore/entryref.h
@@ -2,10 +2,9 @@
#pragma once
-#include <stdint.h>
+#include <cstdint>
-namespace search {
-namespace datastore {
+namespace search::datastore {
class EntryRef {
protected:
@@ -59,6 +58,4 @@ public:
static uint64_t pad(uint64_t val) { return (-val & PadConstant); }
};
-} // namespace search::datastore
-} // namespace search
-
+}
diff --git a/searchlib/src/vespa/searchlib/datastore/free_list_allocator.h b/searchlib/src/vespa/searchlib/datastore/free_list_allocator.h
index 92dd02f9103..a23cb71b90c 100644
--- a/searchlib/src/vespa/searchlib/datastore/free_list_allocator.h
+++ b/searchlib/src/vespa/searchlib/datastore/free_list_allocator.h
@@ -4,8 +4,7 @@
#include "allocator.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Allocator used to allocate entries of a specific type in an underlying data store
@@ -34,4 +33,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/free_list_allocator.hpp b/searchlib/src/vespa/searchlib/datastore/free_list_allocator.hpp
index 6ed1c324b06..5db3e49119f 100644
--- a/searchlib/src/vespa/searchlib/datastore/free_list_allocator.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/free_list_allocator.hpp
@@ -5,8 +5,7 @@
#include "free_list_allocator.h"
#include "bufferstate.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
template <typename EntryT, typename RefT, typename ReclaimerT>
FreeListAllocator<EntryT, RefT, ReclaimerT>::FreeListAllocator(DataStoreBase &store, uint32_t typeId)
@@ -102,4 +101,4 @@ FreeListAllocator<EntryT, RefT, ReclaimerT>::allocArray(size_t size)
}
}
-}
+
diff --git a/searchlib/src/vespa/searchlib/datastore/handle.h b/searchlib/src/vespa/searchlib/datastore/handle.h
index b6119f4446d..c0dce8d3d75 100644
--- a/searchlib/src/vespa/searchlib/datastore/handle.h
+++ b/searchlib/src/vespa/searchlib/datastore/handle.h
@@ -4,8 +4,7 @@
#include "entryref.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Handle to data allocated in a data store and a EntryRef used for read-only access to data later.
@@ -20,4 +19,3 @@ struct Handle
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/i_compaction_context.h b/searchlib/src/vespa/searchlib/datastore/i_compaction_context.h
index afa7d0dff47..aa537968f1c 100644
--- a/searchlib/src/vespa/searchlib/datastore/i_compaction_context.h
+++ b/searchlib/src/vespa/searchlib/datastore/i_compaction_context.h
@@ -4,8 +4,7 @@
#include <vespa/vespalib/util/array.h>
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* A compaction context is used when performing a compaction of data buffers in a data store.
@@ -20,4 +19,3 @@ struct ICompactionContext {
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/raw_allocator.h b/searchlib/src/vespa/searchlib/datastore/raw_allocator.h
index 31c2d959648..d0b7d1d1ca2 100644
--- a/searchlib/src/vespa/searchlib/datastore/raw_allocator.h
+++ b/searchlib/src/vespa/searchlib/datastore/raw_allocator.h
@@ -6,8 +6,7 @@
#include "entryref.h"
#include "handle.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Allocator used to allocate raw buffers (EntryT *) in an underlying data store
@@ -33,4 +32,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/raw_allocator.hpp b/searchlib/src/vespa/searchlib/datastore/raw_allocator.hpp
index 4e43a212fbd..1c72d793ec6 100644
--- a/searchlib/src/vespa/searchlib/datastore/raw_allocator.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/raw_allocator.hpp
@@ -5,8 +5,7 @@
#include "raw_allocator.h"
#include "bufferstate.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
template <typename EntryT, typename RefT>
RawAllocator<EntryT, RefT>::RawAllocator(DataStoreBase &store, uint32_t typeId)
@@ -30,4 +29,4 @@ RawAllocator<EntryT, RefT>::alloc(size_t numElems, size_t extraElems)
}
}
-}
+
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store.h b/searchlib/src/vespa/searchlib/datastore/unique_store.h
index cd5f9c9e489..15dc485b1da 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store.h
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store.h
@@ -10,8 +10,7 @@
#include <vespa/vespalib/util/array.h>
#include <vespa/searchlib/btree/btree.h>
-namespace search {
-namespace datastore {
+namespace search::datastore {
template <typename EntryT, typename RefT>
class UniqueStoreBuilder;
@@ -117,4 +116,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store.hpp b/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
index 37835f1ea3f..603b6e53a85 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store.hpp
@@ -15,8 +15,7 @@
#include "unique_store_saver.hpp"
#include <atomic>
-namespace search {
-namespace datastore {
+namespace search::datastore {
constexpr size_t NUMCLUSTERS_FOR_NEW_UNIQUESTORE_BUFFER = 1024u;
@@ -252,4 +251,3 @@ UniqueStore<EntryT, RefT>::getNumUniques() const
}
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store_builder.h b/searchlib/src/vespa/searchlib/datastore/unique_store_builder.h
index f6bac2eb869..0a3ec447e67 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store_builder.h
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store_builder.h
@@ -4,8 +4,7 @@
#include "unique_store.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Builder for related UniqueStore class.
@@ -45,4 +44,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store_builder.hpp b/searchlib/src/vespa/searchlib/datastore/unique_store_builder.hpp
index 5182942f301..9445eb3a9f2 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store_builder.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store_builder.hpp
@@ -11,8 +11,7 @@
#include <vespa/searchlib/btree/btreeiterator.hpp>
#include <vespa/searchlib/btree/btreenode.hpp>
-namespace search {
-namespace datastore {
+namespace search::datastore {
template <typename EntryT, typename RefT>
UniqueStoreBuilder<EntryT, RefT>::UniqueStoreBuilder(DataStoreType &store, uint32_t typeId, Dictionary &dict, uint32_t uniqueValuesHint)
@@ -57,4 +56,4 @@ UniqueStoreBuilder<EntryT, RefT>::makeDictionary()
}
}
-}
+
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store_saver.h b/searchlib/src/vespa/searchlib/datastore/unique_store_saver.h
index 74719fe83fa..6fdcf2da83a 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store_saver.h
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store_saver.h
@@ -4,8 +4,7 @@
#include "unique_store.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
/**
* Saver for related UniqueStore class.
@@ -50,4 +49,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/datastore/unique_store_saver.hpp b/searchlib/src/vespa/searchlib/datastore/unique_store_saver.hpp
index 0b54d454c14..3377b674930 100644
--- a/searchlib/src/vespa/searchlib/datastore/unique_store_saver.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/unique_store_saver.hpp
@@ -4,8 +4,7 @@
#include "unique_store_saver.h"
-namespace search {
-namespace datastore {
+namespace search::datastore {
template <typename EntryT, typename RefT>
UniqueStoreSaver<EntryT, RefT>::UniqueStoreSaver(const Dictionary &dict, const DataStoreBase &store)
@@ -46,4 +45,3 @@ UniqueStoreSaver<EntryT, RefT>::enumerateValues()
}
}
-}
diff --git a/searchlib/src/vespa/searchlib/engine/docsumapi.cpp b/searchlib/src/vespa/searchlib/engine/docsumapi.cpp
index 6e5c9b20af7..8ba59164831 100644
--- a/searchlib/src/vespa/searchlib/engine/docsumapi.cpp
+++ b/searchlib/src/vespa/searchlib/engine/docsumapi.cpp
@@ -2,8 +2,7 @@
#include "docsumapi.h"
#include <cassert>
-namespace search {
-namespace engine {
+namespace search::engine {
DocsumReply::UP
DocsumServer::getDocsums(DocsumRequest::UP request)
@@ -14,4 +13,3 @@ DocsumServer::getDocsums(DocsumRequest::UP request)
}
}
-}
diff --git a/searchlib/src/vespa/searchlib/engine/docsumapi.h b/searchlib/src/vespa/searchlib/engine/docsumapi.h
index 0d944d533b2..dc51a7319a9 100644
--- a/searchlib/src/vespa/searchlib/engine/docsumapi.h
+++ b/searchlib/src/vespa/searchlib/engine/docsumapi.h
@@ -5,8 +5,7 @@
#include "docsumrequest.h"
#include "docsumreply.h"
-namespace search {
-namespace engine {
+namespace search::engine {
/**
* A docsum client is the object being notified of the completion of
@@ -69,6 +68,4 @@ public:
virtual ~DocsumServer() {}
};
-} // namespace engine
-} // namespace search
-
+}
diff --git a/searchlib/src/vespa/searchlib/engine/docsumrequest.h b/searchlib/src/vespa/searchlib/engine/docsumrequest.h
index 1ac497961be..a0955aaa473 100644
--- a/searchlib/src/vespa/searchlib/engine/docsumrequest.h
+++ b/searchlib/src/vespa/searchlib/engine/docsumrequest.h
@@ -8,9 +8,9 @@
#include "request.h"
#include "source_description.h"
-namespace search {
-namespace fs4transport { class FS4Packet_GETDOCSUMSX; }
-namespace engine {
+namespace search::fs4transport { class FS4Packet_GETDOCSUMSX; }
+
+namespace search::engine {
class DocsumRequest : public Request
{
@@ -91,6 +91,4 @@ public:
bool useRootSlime() const { return _useRootSlime; }
};
-} // namespace engine
-} // namespace search
-
+}
diff --git a/searchlib/src/vespa/searchlib/engine/propertiesmap.h b/searchlib/src/vespa/searchlib/engine/propertiesmap.h
index f96790abbd9..d4d4598add2 100644
--- a/searchlib/src/vespa/searchlib/engine/propertiesmap.h
+++ b/searchlib/src/vespa/searchlib/engine/propertiesmap.h
@@ -5,8 +5,7 @@
#include <vespa/searchlib/fef/properties.h>
#include <vespa/searchlib/common/mapnames.h>
-namespace search {
-namespace engine {
+namespace search::engine {
/**
* A simple wrapper class used to hold multiple named collections of
@@ -15,8 +14,8 @@ namespace engine {
class PropertiesMap
{
private:
- typedef search::fef::Properties Props;
- typedef vespalib::hash_map<vespalib::string, Props> PropsMap;
+ using Props = search::fef::Properties;
+ using PropsMap = vespalib::hash_map<vespalib::string, Props>;
static Props _emptyProperties;
PropsMap _propertiesMap;
@@ -29,7 +28,7 @@ private:
* @param name name of properties
* @return the properties
**/
- const search::fef::Properties &lookup(const vespalib::stringref &name) const;
+ const Props &lookup(const vespalib::stringref &name) const;
public:
typedef PropsMap::const_iterator ITR;
@@ -44,7 +43,7 @@ public:
* @param name name of properties
* @return the properties
**/
- search::fef::Properties &lookupCreate(const vespalib::stringref &name);
+ Props &lookupCreate(const vespalib::stringref &name);
/**
* Obtain the number of named collection of properties held by
@@ -73,7 +72,7 @@ public:
*
* @return rank properties
**/
- const search::fef::Properties &rankProperties() const {
+ const Props &rankProperties() const {
return lookup(MapNames::RANK);
}
@@ -83,7 +82,7 @@ public:
*
* @return feature overrides
**/
- const search::fef::Properties &featureOverrides() const {
+ const Props &featureOverrides() const {
return lookup(MapNames::FEATURE);
}
@@ -93,7 +92,7 @@ public:
*
* @return highlight terms properties
**/
- const search::fef::Properties &highlightTerms() const {
+ const Props &highlightTerms() const {
return lookup(MapNames::HIGHLIGHTTERMS);
}
@@ -102,7 +101,7 @@ public:
*
* @return match properties
**/
- const search::fef::Properties &matchProperties() const {
+ const Props &matchProperties() const {
return lookup(MapNames::MATCH);
}
@@ -111,7 +110,7 @@ public:
*
* @return cache properties
**/
- const search::fef::Properties &cacheProperties() const {
+ const Props &cacheProperties() const {
return lookup(MapNames::CACHES);
}
@@ -120,12 +119,10 @@ public:
*
* @return model properties
**/
- const search::fef::Properties &modelOverrides() const {
+ const Props &modelOverrides() const {
return lookup(MapNames::MODEL);
}
};
-} // namespace engine
-} // namespace search
-
+}
diff --git a/searchlib/src/vespa/searchlib/engine/request.h b/searchlib/src/vespa/searchlib/engine/request.h
index f4eeea226a6..4a2016f2a4b 100644
--- a/searchlib/src/vespa/searchlib/engine/request.h
+++ b/searchlib/src/vespa/searchlib/engine/request.h
@@ -2,12 +2,10 @@
#pragma once
-#include <vespa/fastos/timestamp.h>
-#include <vespa/vespalib/stllike/string.h>
#include "propertiesmap.h"
+#include <vespa/fastos/timestamp.h>
-namespace search {
-namespace engine {
+namespace search::engine {
class Request
{
@@ -39,6 +37,4 @@ public:
std::vector<char> stackDump;
};
-} // namespace engine
-} // namespace search
-
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/CMakeLists.txt b/searchsummary/src/vespa/searchsummary/docsummary/CMakeLists.txt
index 8d79f2fac3c..9009f0bcbc7 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/CMakeLists.txt
+++ b/searchsummary/src/vespa/searchsummary/docsummary/CMakeLists.txt
@@ -17,7 +17,6 @@ vespa_add_library(searchsummary_docsummary OBJECT
summaryfeaturesdfw.cpp
juniperproperties.cpp
textextractordfw.cpp
- docsumformat.cpp
geoposdfw.cpp
tokenizer.cpp
positionsdfw.cpp
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.cpp
index 131b3ce1e2e..7b463352155 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.cpp
@@ -2,9 +2,7 @@
#include "docsumfieldwriter.h"
#include "idocsumenvironment.h"
-#include "docsumformat.h"
#include "docsumstate.h"
-#include <vespa/searchlib/attribute/iattributemanager.h>
#include <vespa/searchlib/common/documentlocations.h>
#include <vespa/searchlib/common/location.h>
#include <vespa/searchlib/parsequery/stackdumpiterator.h>
@@ -12,8 +10,7 @@
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.docsumfieldwriter");
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
using search::attribute::IAttributeContext;
using search::attribute::IAttributeVector;
@@ -138,8 +135,7 @@ CopyDFW::insertField(uint32_t /*docid*/,
uint32_t len;
const char *spt;
// resolve field
- entry->_resolve_field(&spt, &len,
- &state->_docSumFieldSpace);
+ entry->_resolve_field(&spt, &len, &state->_docSumFieldSpace);
vespalib::Memory value(spt, len);
target.insertString(value);
break; }
@@ -150,8 +146,7 @@ CopyDFW::insertField(uint32_t /*docid*/,
uint32_t len;
const char *dpt;
// resolve field
- entry->_resolve_field(&dpt, &len,
- &state->_docSumFieldSpace);
+ entry->_resolve_field(&dpt, &len, &state->_docSumFieldSpace);
vespalib::Memory value(dpt, len);
target.insertData(value);
break; }
@@ -159,7 +154,4 @@ CopyDFW::insertField(uint32_t /*docid*/,
}
}
-//--------------------------------------------------------------------------
-
-} // namespace docsummary
-} // namespace search
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.h b/searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.h
index 83459c0c7d9..abce5c12227 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumfieldwriter.h
@@ -2,16 +2,14 @@
#pragma once
+#include "urlresult.h"
+#include "resultconfig.h"
#include <vespa/searchlib/util/rawbuf.h>
-#include <vespa/searchsummary/docsummary/urlresult.h>
-#include <vespa/searchsummary/docsummary/resultconfig.h>
#include <vespa/vespalib/data/slime/inserter.h>
-namespace search {
+namespace search { class IAttributeManager; }
-class IAttributeManager;
-
-namespace docsummary {
+namespace search::docsummary {
class GetDocsumsState;
@@ -94,6 +92,4 @@ public:
static IDocsumFieldWriter *create(IAttributeManager & vecMan, const char *vecName);
};
-} // namespace docsummary
-} // namespace search
-
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp
deleted file mode 100644
index 89934ce8aec..00000000000
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include "docsumformat.h"
-#include <cassert>
-
-namespace search::docsummary {
-
-size_t
-DocsumFormat::addByte(search::RawBuf &target, uint8_t value)
-
-{
- target.append(&value, sizeof(value));
- return sizeof(value);
-}
-
-size_t
-DocsumFormat::addShort(search::RawBuf &target, uint16_t value)
-{
- target.append(&value, sizeof(value));
- return sizeof(value);
-}
-
-size_t
-DocsumFormat::addInt32(search::RawBuf &target, uint32_t value)
-{
- target.append(&value, sizeof(value));
- return sizeof(value);
-}
-
-size_t
-DocsumFormat::addFloat(search::RawBuf &target, float value)
-{
- target.append(&value, sizeof(value));
- return sizeof(value);
-}
-
-size_t
-DocsumFormat::addDouble(search::RawBuf &target, double value)
-{
- target.append(&value, sizeof(value));
- return sizeof(value);
-}
-
-size_t
-DocsumFormat::addInt64(search::RawBuf &target, uint64_t value)
-{
- target.append(&value, sizeof(value));
- return sizeof(value);
-}
-
-size_t
-DocsumFormat::addShortData(search::RawBuf &target, const char *buf, uint32_t buflen)
-{
- uint16_t len = (buflen > 0xffff ? 0xffff : buflen);
- target.append(&len, sizeof(len));
- target.append(buf, len);
-
- return sizeof(len) + len;
-}
-
-size_t
-DocsumFormat::addLongData(search::RawBuf &target, const char *buf, uint32_t buflen)
-{
- target.append(&buflen, sizeof(buflen));
- target.append(buf, buflen);
-
- return sizeof(buflen) + buflen;
-}
-
-size_t
-DocsumFormat::addEmpty(ResType type, search::RawBuf &target)
-{
- switch (type) {
- case RES_BYTE:
- return addByte(target, 0);
- case RES_SHORT:
- return addShort(target, 0);
- case RES_INT:
- return addInt32(target, 0);
- case RES_INT64:
- return addInt64(target, 0L);
- case RES_FLOAT:
- return addFloat(target, 0.0f);
- case RES_DOUBLE:
- return addDouble(target, 0.0);
- case RES_STRING:
- case RES_DATA:
- return addShortData(target, "", 0);
- case RES_LONG_STRING:
- case RES_LONG_DATA:
- case RES_XMLSTRING:
- case RES_JSONSTRING:
- case RES_TENSOR:
- case RES_FEATUREDATA:
- return addLongData(target, "", 0);
- }
- assert(type <= RES_FEATUREDATA);
- return 0;
-}
-
-}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.h b/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.h
deleted file mode 100644
index 8aa12b4beb2..00000000000
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumformat.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Copyright (C) 1998-2003 Fast Search & Transfer ASA
-// Copyright (C) 2003 Overture Services Norway AS
-
-#pragma once
-
-#include <vespa/searchlib/util/rawbuf.h>
-#include <vespa/searchsummary/docsummary/resultclass.h>
-
-namespace search {
-namespace docsummary {
-
-class DocsumFormat
-{
-public:
- static size_t addByte(search::RawBuf &target, uint8_t value);
- static size_t addShort(search::RawBuf &target, uint16_t value);
- static size_t addInt32(search::RawBuf &target, uint32_t value);
- static size_t addFloat(search::RawBuf &target, float value);
- static size_t addDouble(search::RawBuf &target, double value);
- static size_t addInt64(search::RawBuf &target, uint64_t value);
- static size_t addShortData(search::RawBuf &target, const char *buf, uint32_t buflen);
- static size_t addLongData(search::RawBuf &target, const char *buf, uint32_t buflen);
-
- static size_t addEmpty(ResType type, search::RawBuf &target);
-
- class Appender {
- private:
- search::RawBuf &_target;
- public:
- Appender(search::RawBuf &target) : _target(target) {}
-
- size_t addByte(uint8_t value) {
- return DocsumFormat::addByte(_target, value);
- }
- size_t addShort(uint16_t value) {
- return DocsumFormat::addShort(_target, value);
- }
- size_t addInt32(uint32_t value) {
- return DocsumFormat::addInt32(_target, value);
- }
- size_t addFloat(float value) {
- return DocsumFormat::addFloat(_target, value);
- }
- size_t addDouble(double value) {
- return DocsumFormat::addDouble(_target, value);
- }
- size_t addInt64(uint64_t value) {
- return DocsumFormat::addInt64(_target, value);
- }
- size_t addShortData(const char *buf, uint32_t buflen) {
- return DocsumFormat::addShortData(_target, buf, buflen);
- }
- size_t addLongData(const char *buf, uint32_t buflen) {
- return DocsumFormat::addLongData(_target, buf, buflen);
- }
-
- size_t addEmpty(ResType type) {
- return DocsumFormat::addEmpty(type, _target);
- }
- };
-
-};
-
-}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumstore.h b/searchsummary/src/vespa/searchsummary/docsummary/docsumstore.h
index 6f88baee117..4b3e27799fe 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumstore.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumstore.h
@@ -6,9 +6,7 @@
#include "docsumstorevalue.h"
-namespace search {
-namespace docsummary {
-
+namespace search::docsummary {
/**
* Interface for object able to fetch docsum blobs based on local
@@ -49,5 +47,3 @@ public:
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumstorevalue.h b/searchsummary/src/vespa/searchsummary/docsummary/docsumstorevalue.h
index ed9afd095ce..a15fb6d8892 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumstorevalue.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumstorevalue.h
@@ -4,8 +4,7 @@
#include <cstdint>
#include <utility>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
/**
* Simple wrapper class containing the location and size of a docsum
@@ -59,5 +58,3 @@ public:
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
index 2558418a229..5798636b1a8 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.cpp
@@ -1,21 +1,18 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "docsumwriter.h"
-#include "docsumformat.h"
#include "docsumstate.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>
-#include <vespa/fastlib/text/normwordfolder.h>
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.docsumwriter");
using namespace vespalib::slime::convenience;
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
uint32_t
IDocsumWriter::slime2RawBuf(const Slime & slime, RawBuf & buf)
@@ -316,6 +313,4 @@ DynamicDocsumWriter::WriteDocsum(uint32_t docid,
return slime2RawBuf(slime, *target);
}
-
-} // namespace search::docsummary
-} // namespace search
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h
index 0d384143c65..46caa26e60b 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/docsumwriter.h
@@ -1,23 +1,20 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Copyright (C) 1998-2003 Fast Search & Transfer ASA
-// Copyright (C) 2003 Overture Services Norway AS
#pragma once
+#include "juniperproperties.h"
+#include "urlresult.h"
+#include "resultconfig.h"
+#include "docsumstore.h"
+#include "keywordextractor.h"
+#include "docsumfieldwriter.h"
#include <vespa/searchlib/util/rawbuf.h>
-#include <vespa/searchsummary/docsummary/urlresult.h>
-#include <vespa/searchsummary/docsummary/resultconfig.h>
-#include <vespa/searchsummary/docsummary/docsumstore.h>
-#include <vespa/searchsummary/docsummary/keywordextractor.h>
-#include <vespa/searchsummary/docsummary/docsumfieldwriter.h>
#include <vespa/fastlib/text/unicodeutil.h>
#include <vespa/fastlib/text/wordfolder.h>
-#include "juniperproperties.h"
using search::IAttributeManager;
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
class IDocsumWriter
{
@@ -112,5 +109,3 @@ public:
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/dynamicteaserdfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/dynamicteaserdfw.cpp
index fbcc5cc88d7..e535eef660c 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/dynamicteaserdfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/dynamicteaserdfw.cpp
@@ -4,9 +4,7 @@
#include "docsumwriter.h"
#include "docsumstate.h"
#include <vespa/searchlib/parsequery/stackdumpiterator.h>
-#include <vespa/searchlib/util/rawbuf.h>
#include <vespa/searchlib/queryeval/split_float.h>
-#include <vespa/searchlib/fef/properties.h>
#include <vespa/vespalib/objects/hexdump.h>
#include <vespa/juniper/config.h>
#include <sstream>
@@ -16,7 +14,6 @@ LOG_SETUP(".searchlib.docsummary.dynamicteaserdfw");
namespace juniper {
-
struct ExplicitItemData
{
const char *_index;
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp
index 1152e1524bb..5856797831a 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp
@@ -3,8 +3,7 @@
#include "getdocsumargs.h"
#include "resultconfig.h"
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
GetDocsumArgs::GetDocsumArgs()
: _ranking(),
@@ -87,4 +86,3 @@ GetDocsumArgs::SetStackDump(uint32_t stackItems, uint32_t stackDumpLen, const ch
}
}
-}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h
index 68358bed589..beca4134946 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.h
@@ -8,8 +8,7 @@
#include <vespa/searchlib/engine/docsumrequest.h>
#include <vespa/searchlib/engine/propertiesmap.h>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
class GetDocsumArgs
{
@@ -86,5 +85,3 @@ public:
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/idocsumenvironment.h b/searchsummary/src/vespa/searchsummary/docsummary/idocsumenvironment.h
index 516b9e24e2d..88f8e4f6c5d 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/idocsumenvironment.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/idocsumenvironment.h
@@ -5,8 +5,7 @@
#include <vespa/searchlib/attribute/iattributemanager.h>
namespace juniper { class Juniper; }
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
/**
* Abstract view of information available to rewriters for generating docsum fields.
@@ -20,5 +19,3 @@ public:
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.cpp b/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.cpp
index 3bf2cdbc928..7f3a31f86c5 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.cpp
@@ -7,8 +7,7 @@
using vespa::config::search::summary::JuniperrcConfig;
using vespalib::make_string;
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
JuniperProperties::JuniperProperties() :
_properties()
@@ -102,12 +101,4 @@ JuniperProperties::GetProperty(const char *name, const char *def)
return it != _properties.end() ? it->second.c_str() : def;
}
-void
-JuniperProperties::SetProperty(const vespalib::string &key, const vespalib::string &val)
-{
- _properties[key] = val;
}
-
-} // namespace docsummary
-} // namespace search
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.h b/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.h
index 114ddb6cc9d..c313b917271 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/juniperproperties.h
@@ -1,13 +1,11 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
+#include <vespa/searchsummary/config/config-juniperrc.h>
#include <vespa/juniper/IJuniperProperties.h>
#include <map>
-#include <vespa/searchsummary/config/config-juniperrc.h>
-#include <string>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
class JuniperProperties : public IJuniperProperties {
private:
@@ -54,17 +52,6 @@ public:
// Inherit doc from IJuniperProperties.
const char *GetProperty(const char *name, const char *def = NULL) override;
-
- /**
- * Sets the value of a given named property. If the property already exists, it is overwritten. If it does not
- * exist, it is added.
- *
- * @param key The name of the property to set.
- * @param val The value to set for the property.
- */
- void SetProperty(const vespalib::string &key, const vespalib::string &val);
};
-} // namespace docsummary
-} // namespace search
-
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp
index d8f6f2c3820..e153a898f6a 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.cpp
@@ -4,18 +4,15 @@
#include "keywordextractor.h"
#include "idocsumenvironment.h"
#include <vespa/searchlib/parsequery/stackdumpiterator.h>
-#include <vespa/searchlib/util/rawbuf.h>
/** Tell us what parts of the query we are interested in */
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
bool useful(search::ParseItem::ItemCreator creator)
{
- switch (creator)
- {
+ switch (creator) {
case search::ParseItem::CREA_ORIG:
return true;
default:
@@ -245,4 +242,3 @@ KeywordExtractor::ExtractKeywords(vespalib::stringref buf) const
}
}
-}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h
index dad824dbe04..3b6779f6c52 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/keywordextractor.h
@@ -7,8 +7,7 @@
#include <vespa/vespalib/stllike/hash_set.h>
#include <vespa/searchlib/util/rawbuf.h>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
class IDocsumEnvironment;
@@ -140,5 +139,3 @@ public:
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.cpp b/searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.cpp
index 36527b0eb24..b4a03e8c9a1 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.cpp
@@ -1,7 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "linguisticsannotation.h"
-#include <vespa/document/datatype/datatype.h>
#include <vespa/document/datatype/primitivedatatype.h>
using document::AnnotationType;
@@ -9,8 +8,7 @@ using document::DataType;
using document::PrimitiveDataType;
using vespalib::string;
-namespace search {
-namespace linguistics {
+namespace search::linguistics {
namespace {
AnnotationType makeType(int id, string name, const DataType &type) {
@@ -26,5 +24,4 @@ AnnotationType TERM_OBJ(makeType(1, "term", STRING_OBJ));
const string SPANTREE_NAME("linguistics");
const AnnotationType *const TERM(&TERM_OBJ);
-} // namespace search::linguistics
-} // namespace search
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.h b/searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.h
index a643df3d6cd..1ffa000c74e 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/linguisticsannotation.h
@@ -3,13 +3,10 @@
#pragma once
#include <vespa/document/datatype/annotationtype.h>
-#include <vespa/vespalib/stllike/string.h>
-namespace search {
-namespace linguistics {
+namespace search::linguistics {
extern const vespalib::string SPANTREE_NAME;
extern const document::AnnotationType *const TERM;
-} // namespace search::linguistics
-} // namespace search
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.cpp
index 5d214d02455..fdc38d8d6f9 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.cpp
@@ -1,15 +1,11 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "rankfeaturesdfw.h"
-#include "docsumformat.h"
#include "docsumstate.h"
-#include <vespa/searchlib/common/feature.h>
-#include <vespa/searchlib/common/featureset.h>
#include <vespa/searchlib/common/packets.h>
#include <vespa/vespalib/data/slime/cursor.h>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
RankFeaturesDFW::RankFeaturesDFW() :
_env(NULL)
@@ -24,11 +20,8 @@ RankFeaturesDFW::init(IDocsumEnvironment * env)
}
void
-RankFeaturesDFW::insertField(uint32_t docid,
- GeneralResult *,
- GetDocsumsState *state,
- ResType type,
- vespalib::slime::Inserter &target)
+RankFeaturesDFW::insertField(uint32_t docid, GeneralResult *, GetDocsumsState *state,
+ ResType type, vespalib::slime::Inserter &target)
{
if (state->_rankFeatures.get() == NULL) {
state->_callback.FillRankFeatures(state, _env);
@@ -67,4 +60,3 @@ RankFeaturesDFW::insertField(uint32_t docid,
}
}
-}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.h b/searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.h
index fdb10f1b9eb..04ee14c79ca 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/rankfeaturesdfw.h
@@ -2,12 +2,9 @@
#pragma once
-#include <map>
-#include <string>
-#include <vespa/searchsummary/docsummary/summaryfeaturesdfw.h>
+#include "summaryfeaturesdfw.h"
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
class RankFeaturesDFW : public FeaturesDFW
{
@@ -19,16 +16,11 @@ private:
public:
RankFeaturesDFW();
- virtual ~RankFeaturesDFW();
+ ~RankFeaturesDFW();
void init(IDocsumEnvironment * env);
- virtual bool IsGenerated() const override { return true; }
- virtual void insertField(uint32_t docid,
- GeneralResult *gres,
- GetDocsumsState *state,
- ResType type,
- vespalib::slime::Inserter &target) override;
+ bool IsGenerated() const override { return true; }
+ void insertField(uint32_t docid, GeneralResult *gres, GetDocsumsState *state,
+ ResType type, vespalib::slime::Inserter &target) override;
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp b/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp
index a87af85f099..507ec7b3866 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/resultclass.cpp
@@ -5,8 +5,7 @@
#include <cassert>
#include <zlib.h>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
ResultClass::ResultClass(const char *name, uint32_t id, util::StringEnum & fieldEnum)
: _name(name),
@@ -101,4 +100,3 @@ ResEntry::_extract_field(search::RawBuf *target) const
}
}
-}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultclass.h b/searchsummary/src/vespa/searchsummary/docsummary/resultclass.h
index 462fc382493..d1504ed5bdd 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/resultclass.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/resultclass.h
@@ -1,6 +1,4 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Copyright (C) 2001-2003 Fast Search & Transfer ASA
-// Copyright (C) 2003 Overture Services Norway AS
#pragma once
@@ -9,8 +7,7 @@
#include <vespa/vespalib/stllike/hash_map.h>
#include <vespa/searchlib/util/stringenum.h>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
/**
* This enumeration contains values denoting the different types of
@@ -286,7 +283,4 @@ public:
}
};
-
-}
}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp b/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp
index cd4cceb849e..1c42709826f 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.cpp
@@ -7,8 +7,7 @@
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.resultconfig");
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
void
ResultConfig::Clean()
@@ -242,5 +241,4 @@ ResultConfig::Unpack(uint32_t partition,
return (ret != NULL) ? ret : new badurlresult(partition, docid, metric);
}
-} // namespace docsummary
-} // namespace search
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h b/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h
index 8d2c5f94cf1..eac6d4b113f 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/resultconfig.h
@@ -1,17 +1,14 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Copyright (C) 2001-2003 Fast Search & Transfer ASA
-// Copyright (C) 2003 Overture Services Norway AS
#pragma once
+#include "resultclass.h"
+#include "urlresult.h"
#include <vespa/config-summary.h>
#include <vespa/searchlib/util/rawbuf.h>
#include <vespa/searchlib/util/stringenum.h>
-#include <vespa/searchsummary/docsummary/resultclass.h>
-#include <vespa/searchsummary/docsummary/urlresult.h>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
/**
* This class represents the overall result configuration. A result
@@ -298,5 +295,3 @@ public:
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultpacker.cpp b/searchsummary/src/vespa/searchsummary/docsummary/resultpacker.cpp
index 147c0bf6559..178e1a90667 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/resultpacker.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/resultpacker.cpp
@@ -6,8 +6,7 @@
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.resultpacker");
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
void
ResultPacker::WarnType(ResType type) const
@@ -282,12 +281,4 @@ ResultPacker::GetDocsumBlob(const char **buf, uint32_t *buflen)
}
}
-void
-ResultPacker::GetDocsumBlobForce(const char **buf, uint32_t *buflen)
-{
- *buf = _buf.GetDrainPos();
- *buflen = _buf.GetUsedLen();
-}
-
-}
}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/resultpacker.h b/searchsummary/src/vespa/searchsummary/docsummary/resultpacker.h
index d2959f25c5a..3dd643406d7 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/resultpacker.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/resultpacker.h
@@ -4,10 +4,9 @@
#pragma once
-#include <vespa/searchsummary/docsummary/resultconfig.h>
+#include "resultconfig.h"
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
/**
* An Object of this class may be used to create docsum blobs. A
* single blob is created by first indicating what result class the
@@ -252,10 +251,6 @@ public:
**/
bool GetDocsumBlob(const char **buf, uint32_t *buflen);
- void GetDocsumBlobForce(const char **buf, uint32_t *buflen);
};
}
-}
-
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.cpp b/searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.cpp
index c3f62d71de6..7d8bd2a7c22 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.cpp
@@ -1,7 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "searchdatatype.h"
-#include <vespa/document/base/field.h>
#include <vespa/document/datatype/primitivedatatype.h>
#include <vespa/document/datatype/structdatatype.h>
@@ -10,8 +9,7 @@ using document::Field;
using document::PrimitiveDataType;
using document::StructDataType;
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
namespace {
@@ -32,5 +30,4 @@ const StructDataType *setUpUriType() {
const DataType *SearchDataType::URI(setUpUriType());
-} // namespace search::docsummary
-} // namespace search
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.h b/searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.h
index 7cb30136dee..cf1a08a50df 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/searchdatatype.h
@@ -4,12 +4,10 @@
#include <vespa/document/datatype/datatype.h>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
struct SearchDataType {
static const document::DataType *URI;
};
-} // namespace search::docsummary
-} // namespace search
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.cpp
index 42e2db72dad..c21d6c40066 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.cpp
@@ -1,18 +1,14 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include "docsumformat.h"
#include "summaryfeaturesdfw.h"
#include "docsumstate.h"
-#include <vespa/searchlib/common/featureset.h>
#include <vespa/searchlib/common/packets.h>
#include <vespa/vespalib/data/slime/cursor.h>
-#include <cmath>
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.summaryfeaturesdfw");
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
SummaryFeaturesDFW::SummaryFeaturesDFW() :
@@ -34,15 +30,12 @@ static vespalib::string _G_cached("vespa.summaryFeatures.cached");
static vespalib::Memory _M_cached("vespa.summaryFeatures.cached");
void
-SummaryFeaturesDFW::insertField(uint32_t docid,
- GeneralResult *,
- GetDocsumsState *state,
- ResType type,
- vespalib::slime::Inserter &target)
+SummaryFeaturesDFW::insertField(uint32_t docid, GeneralResult *, GetDocsumsState *state,
+ ResType type, vespalib::slime::Inserter &target)
{
- if (state->_summaryFeatures.get() == 0) {
+ if ( ! state->_summaryFeatures) {
state->_callback.FillSummaryFeatures(state, _env);
- if (state->_summaryFeatures.get() == 0) { // still no summary features to write
+ if ( !state->_summaryFeatures) { // still no summary features to write
return;
}
}
@@ -75,8 +68,7 @@ SummaryFeaturesDFW::insertField(uint32_t docid,
json.appendDouble(0.0);
}
json.endObject();
- vespalib::Memory value(json.toString().c_str(),
- json.toString().size());
+ vespalib::Memory value(json.toString().c_str(), json.toString().size());
if (type == RES_STRING || type == RES_LONG_STRING) {
target.insertString(value);
}
@@ -97,23 +89,4 @@ void FeaturesDFW::featureDump(vespalib::JSONStringer & json, const vespalib::str
}
}
-
-uint32_t
-SummaryFeaturesDFW::writeString(const vespalib::stringref & str, ResType type, search::RawBuf * target)
-{
- switch (type) {
- case RES_STRING:
- case RES_DATA:
- return DocsumFormat::addShortData(*target, str.c_str(), str.size());
- case RES_FEATUREDATA:
- case RES_LONG_STRING:
- case RES_LONG_DATA:
- return DocsumFormat::addLongData(*target, str.c_str(), str.size());
- default:
- LOG(error, "unhandled type %u in writeString()", type);
- return DocsumFormat::addEmpty(type, *target);
- }
-}
-
-}
}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.h b/searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.h
index ba9b9878f24..c406a9f9dee 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/summaryfeaturesdfw.h
@@ -2,13 +2,11 @@
#pragma once
-#include <map>
-#include <string>
-#include <vespa/searchsummary/docsummary/docsumfieldwriter.h>
-#include <vespa/vespalib/util/jsonwriter.h>
+#include "docsumfieldwriter.h"
-namespace search {
-namespace docsummary {
+namespace vespalib { class JSONStringer; }
+
+namespace search::docsummary {
class IDocsumEnvironment;
@@ -28,18 +26,11 @@ private:
public:
SummaryFeaturesDFW();
- virtual ~SummaryFeaturesDFW();
+ ~SummaryFeaturesDFW();
void init(IDocsumEnvironment * env);
- virtual bool IsGenerated() const override { return true; }
- virtual void insertField(uint32_t docid,
- GeneralResult *gres,
- GetDocsumsState *state,
- ResType type,
- vespalib::slime::Inserter &target) override;
-
- static uint32_t writeString(const vespalib::stringref & str, ResType type, search::RawBuf * target);
+ bool IsGenerated() const override { return true; }
+ void insertField(uint32_t docid, GeneralResult *gres, GetDocsumsState *state,
+ ResType type, vespalib::slime::Inserter &target) override;
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp b/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp
index cee3455b957..290cc45648a 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/summaryfieldconverter.cpp
@@ -5,20 +5,13 @@
#include "searchdatatype.h"
#include <vespa/document/annotation/alternatespanlist.h>
#include <vespa/document/annotation/annotation.h>
-#include <vespa/document/annotation/span.h>
-#include <vespa/document/annotation/spanlist.h>
-#include <vespa/document/annotation/spannode.h>
#include <vespa/document/annotation/spantree.h>
#include <vespa/document/annotation/spantreevisitor.h>
-#include <vespa/document/datatype/arraydatatype.h>
-#include <vespa/document/datatype/datatype.h>
#include <vespa/document/datatype/documenttype.h>
-#include <vespa/document/datatype/weightedsetdatatype.h>
#include <vespa/document/fieldvalue/arrayfieldvalue.h>
#include <vespa/document/fieldvalue/bytefieldvalue.h>
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/fieldvalue/doublefieldvalue.h>
-#include <vespa/document/fieldvalue/fieldvaluevisitor.h>
#include <vespa/document/fieldvalue/floatfieldvalue.h>
#include <vespa/document/fieldvalue/intfieldvalue.h>
#include <vespa/document/fieldvalue/longfieldvalue.h>
@@ -35,11 +28,8 @@
#include <vespa/vespalib/encoding/base64.h>
#include <vespa/vespalib/geo/zcurve.h>
#include <vespa/vespalib/stllike/asciistream.h>
-#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/vespalib/data/slime/slime.h>
-#include <vespa/vespalib/data/slime/convenience.h>
-#include <vespa/vespalib/data/slime/binary_format.h>
#include <vespa/eval/tensor/serialization/slime_binary_format.h>
#include <vespa/eval/tensor/serialization/typed_binary_format.h>
#include <vespa/vespalib/objects/nbostream.h>
@@ -90,8 +80,7 @@ using vespalib::make_string;
using vespalib::string;
using vespalib::stringref;
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
namespace {
string getSpanString(const string &s, const Span &span) {
@@ -522,5 +511,4 @@ SummaryFieldConverter::convertSummaryField(bool markup,
}
-} // namespace search::docsummary
-} // namespace search
+}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.cpp
index 4f309c36f74..121520c4d03 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.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 "tokenizer.h"
#include "textextractordfw.h"
+#include "tokenizer.h"
#include "docsumstate.h"
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.docsummary.textextractordfw");
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
TextExtractorDFW::TextExtractorDFW() :
_inputFieldEnum(-1)
@@ -53,5 +52,3 @@ TextExtractorDFW::insertField(uint32_t,
}
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.h b/searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.h
index ad611c129de..e30941bf8f9 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/textextractordfw.h
@@ -2,10 +2,9 @@
#pragma once
-#include <vespa/searchsummary/docsummary/docsumfieldwriter.h>
+#include "docsumfieldwriter.h"
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
/**
* This is the docsum field writer used to extract the original text from a disk summary on the juniper format.
@@ -20,18 +19,11 @@ private:
public:
TextExtractorDFW();
- virtual ~TextExtractorDFW() {}
+ ~TextExtractorDFW() {}
bool init(const vespalib::string & fieldName, const vespalib::string & inputField, const ResultConfig & config);
- // Inherit doc
- virtual bool IsGenerated() const override { return false; }
- // Inherit doc
- virtual void insertField(uint32_t docid,
- GeneralResult *gres,
- GetDocsumsState *state,
- ResType type,
- vespalib::slime::Inserter &target) override;
+ bool IsGenerated() const override { return false; }
+ void insertField(uint32_t docid, GeneralResult *gres, GetDocsumsState *state,
+ ResType type, vespalib::slime::Inserter &target) override;
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/tokenizer.cpp b/searchsummary/src/vespa/searchsummary/docsummary/tokenizer.cpp
index 5a807e564ef..003b9920068 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/tokenizer.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/tokenizer.cpp
@@ -3,8 +3,7 @@
#include "tokenizer.h"
#include <cassert>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
Tokenizer::Token::Type
Tokenizer::getTokenType(ucs4_t ch) const
@@ -107,4 +106,3 @@ Tokenizer::getNextToken()
}
}
-}
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/tokenizer.h b/searchsummary/src/vespa/searchsummary/docsummary/tokenizer.h
index 59762ec2d95..e7d6916d452 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/tokenizer.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/tokenizer.h
@@ -2,11 +2,10 @@
#pragma once
-#include <vespa/fastlib/text/unicodeutil.h>
#include "itokenizer.h"
+#include <vespa/fastlib/text/unicodeutil.h>
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
/**
* This class is used to tokenize an utf-8 text buffer into tokens of type
@@ -43,5 +42,3 @@ public:
};
}
-}
-
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/urlresult.h b/searchsummary/src/vespa/searchsummary/docsummary/urlresult.h
index b076f82e440..97e31e47996 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/urlresult.h
+++ b/searchsummary/src/vespa/searchsummary/docsummary/urlresult.h
@@ -1,14 +1,11 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Copyright (C) 2001-2003 Fast Search & Transfer ASA
-// Copyright (C) 2003 Overture Services Norway AS
#pragma once
-#include <vespa/searchsummary/docsummary/resultclass.h>
-#include <vespa/searchsummary/docsummary/docsumstorevalue.h>
+#include "resultclass.h"
+#include "docsumstorevalue.h"
-namespace search {
-namespace docsummary {
+namespace search::docsummary {
class urlresult
{
@@ -85,6 +82,3 @@ public:
};
}
-}
-
-