blob: 28c7ffd2b36fcbb4d38251c116c6d54333bb44b3 (
plain) (
blame)
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
37
38
39
40
41
42
43
44
45
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "matchview.h"
#include <vespa/searchcore/proton/docsummary/isummarymanager.h>
#include <vespa/searchcore/proton/summaryengine/isearchhandler.h>
namespace proton {
class SearchView : public ISearchHandler
{
public:
using SessionManagerSP = std::shared_ptr<matching::SessionManager>;
using IndexSearchable = searchcorespi::IndexSearchable;
using InternalDocsumReply = std::pair<std::unique_ptr<DocsumReply>, bool>;
typedef std::shared_ptr<SearchView> SP;
SearchView(const ISummaryManager::ISummarySetup::SP &summarySetup, const MatchView::SP &matchView);
SearchView(const SearchView &) = delete;
SearchView(SearchView &&) = delete;
SearchView &operator=(const SearchView &) = delete;
SearchView &operator=(SearchView &&) = delete;
~SearchView();
const ISummaryManager::ISummarySetup::SP & getSummarySetup() const { return _summarySetup; }
const MatchView::SP & getMatchView() const { return _matchView; }
const Matchers::SP & getMatchers() const { return _matchView->getMatchers(); }
const IndexSearchable::SP & getIndexSearchable() const { return _matchView->getIndexSearchable(); }
const IAttributeManager::SP & getAttributeManager() const { return _matchView->getAttributeManager(); }
const SessionManagerSP & getSessionManager() const { return _matchView->getSessionManager(); }
const IDocumentMetaStoreContext::SP & getDocumentMetaStore() const { return _matchView->getDocumentMetaStore(); }
DocIdLimit &getDocIdLimit() const { return _matchView->getDocIdLimit(); }
matching::MatchingStats getMatcherStats(const vespalib::string &rankProfile) const { return _matchView->getMatcherStats(rankProfile); }
std::unique_ptr<DocsumReply> getDocsums(const DocsumRequest & req) override;
std::unique_ptr<SearchReply> match(const ISearchHandler::SP &self, const SearchRequest &req, vespalib::ThreadBundle &threadBundle) const override;
private:
InternalDocsumReply getDocsumsInternal(const DocsumRequest & req);
ISummaryManager::ISummarySetup::SP _summarySetup;
MatchView::SP _matchView;
};
} // namespace proton
|