aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h
blob: 2d19a23fdabea3a13775eb04c141f0ab218f392e (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "searchable.h"
#include "irequestcontext.h"
#include <vespa/searchlib/fef/matchdatalayout.h>

namespace search::fef { class TermFieldMatchData; }

namespace search::queryeval {

class SimplePhraseBlueprint : public ComplexLeafBlueprint
{
private:
    const vespalib::Doom    _doom; 
    FieldSpec               _field;
    HitEstimate             _estimate;
    fef::MatchDataLayout    _layout;
    std::vector<Blueprint*> _terms;

    SimplePhraseBlueprint(const SimplePhraseBlueprint &); // disabled
    SimplePhraseBlueprint &operator=(const SimplePhraseBlueprint &); // disabled

public:
    SimplePhraseBlueprint(const FieldSpec &field, const IRequestContext & requestContext);
    ~SimplePhraseBlueprint();

    // used by create visitor
    FieldSpec getNextChildField(const FieldSpec &outer);

    // used by create visitor
    void addTerm(Blueprint::UP term);

    SearchIteratorUP createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, bool strict) const override;
    void visitMembers(vespalib::ObjectVisitor &visitor) const override;
    void fetchPostings(bool strict, const BitVector * filter) override;
};

}