1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "minimal_document_retriever.h"
#include <vespa/searchlib/docstore/idocumentstore.h>
using document::Document;
using document::DocumentTypeRepo;
using search::DocumentIdT;
using search::IDocumentStore;
namespace proton {
MinimalDocumentRetriever::MinimalDocumentRetriever(
const DocTypeName &docTypeName,
const std::shared_ptr<const DocumentTypeRepo> repo,
const IDocumentMetaStoreContext &meta_store,
const IDocumentStore &doc_store,
bool hasFields)
: DocumentRetrieverBase(docTypeName, *repo, meta_store, hasFields),
_repo(repo),
_doc_store(doc_store) {
}
MinimalDocumentRetriever::~MinimalDocumentRetriever() = default;
Document::UP
MinimalDocumentRetriever::getFullDocument(DocumentIdT lid) const {
return _doc_store.read(lid, *_repo);
}
void
MinimalDocumentRetriever::visitDocuments(const LidVector & lids, search::IDocumentVisitor & visitor, ReadConsistency) const {
_doc_store.visit(lids, getDocumentTypeRepo(), visitor);
}
} // namespace proton
|