aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/server/searchcontext.h
blob: f3fcd856a28a58b5fd50a43355eb43ee17b37ef9 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/searchlib/attribute/attribute_blueprint_factory.h>
#include <vespa/searchcore/proton/matching/isearchcontext.h>

namespace proton {

/**
 * Defines the context for a search within the document type owned by
 * this database. SearchContext contains the context for a search for
 * the documenttype.  First create, search and rank, then group/sort,
 * collect hits.
 */
class SearchContext final : public matching::ISearchContext
{
private:
    /// Snapshot of the indexes used.
    std::shared_ptr<IndexSearchable>  _indexSearchable;
    search::AttributeBlueprintFactory _attributeBlueprintFactory;
    uint32_t                          _docIdLimit;

    IndexSearchable &getIndexes() override;
    Searchable &getAttributes() override;
    uint32_t getDocIdLimit() override;

public:
    SearchContext(const std::shared_ptr<IndexSearchable> &indexSearchable, uint32_t docIdLimit);
    ~SearchContext() override;
};

} // namespace proton