aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/attribute/empty_search_context.cpp
blob: 795cbc3d6f05ef397279fb24360436063d380e87 (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
46
47
48
49
50
51
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "empty_search_context.h"
#include <vespa/searchlib/queryeval/emptysearch.h>

namespace search::attribute {

EmptySearchContext::EmptySearchContext(const AttributeVector& attr) noexcept
    : SearchContext(attr)
{
}

EmptySearchContext::~EmptySearchContext() = default;

int32_t
EmptySearchContext::onFind(DocId, int32_t, int32_t&) const
{
    return -1;
}

int32_t
EmptySearchContext::onFind(DocId, int32_t) const
{
    return -1;
}

HitEstimate
EmptySearchContext::calc_hit_estimate() const
{
    return HitEstimate(0);
}

uint32_t
EmptySearchContext::get_committed_docid_limit() const noexcept
{
    return 0u;
}

std::unique_ptr<queryeval::SearchIterator>
EmptySearchContext::createIterator(fef::TermFieldMatchData*, bool)
{
    return std::make_unique<queryeval::EmptySearch>();
}

std::unique_ptr<queryeval::SearchIterator>
EmptySearchContext::createFilterIterator(fef::TermFieldMatchData*, bool)
{
    return std::make_unique<queryeval::EmptySearch>();
}

}