summaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/queryeval/executeinfo.h
blob: 7c63b167914e0155901060f1a2cdda78d00c128b (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
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Copyright 2019 Oath inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

namespace search::queryeval {

/**
 * Holds information about how query will be executed and how large part of corpus will pass through.
 * @author baldersheim
 */
class ExecuteInfo {
public:
    ExecuteInfo() : ExecuteInfo(false, 1.0) { }
    bool isStrict() const { return _strict; }
    double hitRate() const { return _hitRate; }
    static const ExecuteInfo TRUE;
    static const ExecuteInfo FALSE;
    static ExecuteInfo create(bool strict);
    static ExecuteInfo create(bool strict, double HitRate);
private:
    ExecuteInfo(bool strict, double hitRate_in)
        : _hitRate(hitRate_in),
          _strict(strict)
    { }
    double _hitRate;
    bool  _strict;
};

}