// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "matchview.h" #include #include namespace proton { class SearchView : public ISearchHandler, public std::enable_shared_from_this { public: using SessionManager = matching::SessionManager; using IndexSearchable = searchcorespi::IndexSearchable; using InternalDocsumReply = std::pair, bool>; using SP = std::shared_ptr; static std::shared_ptr create(std::shared_ptr summarySetup, std::shared_ptr matchView); SearchView(const SearchView &) = delete; SearchView(SearchView &&) = delete; SearchView &operator=(const SearchView &) = delete; SearchView &operator=(SearchView &&) = delete; ~SearchView() override; const std::shared_ptr& getSummarySetup() const noexcept { return _summarySetup; } const std::shared_ptr& getMatchView() const noexcept { return _matchView; } const std::shared_ptr& getMatchers() const noexcept { return _matchView->getMatchers(); } const std::shared_ptr& getIndexSearchable() const noexcept { return _matchView->getIndexSearchable(); } const std::shared_ptr& getAttributeManager() const noexcept { return _matchView->getAttributeManager(); } SessionManager & getSessionManager() const noexcept { return _matchView->getSessionManager(); } const std::shared_ptr& getDocumentMetaStore() const noexcept { return _matchView->getDocumentMetaStore(); } DocIdLimit &getDocIdLimit() const noexcept { return _matchView->getDocIdLimit(); } matching::MatchingStats getMatcherStats(const vespalib::string &rankProfile) const { return _matchView->getMatcherStats(rankProfile); } std::unique_ptr getDocsums(const DocsumRequest & req) override; std::unique_ptr match(const SearchRequest &req, vespalib::ThreadBundle &threadBundle) const override; private: SearchView(std::shared_ptr summarySetup, std::shared_ptr matchView); InternalDocsumReply getDocsumsInternal(const DocsumRequest & req); std::shared_ptr _summarySetup; std::shared_ptr _matchView; }; } // namespace proton