blob: 698e2235690e48d703a17f9d7a1d46c3d871881c (
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "blueprint.h"
#include "simpleresult.h"
#include "fake_result.h"
#include "searchable.h"
namespace search::queryeval {
//-----------------------------------------------------------------------------
class EmptyBlueprint : public SimpleLeafBlueprint
{
protected:
SearchIterator::UP
createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, bool strict) const override;
public:
EmptyBlueprint(const FieldSpecBaseList &fields);
EmptyBlueprint(const FieldSpecBase &field);
EmptyBlueprint();
};
//-----------------------------------------------------------------------------
class SimpleBlueprint : public SimpleLeafBlueprint
{
private:
vespalib::string _tag;
SimpleResult _result;
protected:
SearchIterator::UP
createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, bool strict) const override;
public:
SimpleBlueprint(const SimpleResult &result);
~SimpleBlueprint();
SimpleBlueprint &tag(const vespalib::string &tag);
const vespalib::string &tag() const { return _tag; }
};
//-----------------------------------------------------------------------------
class FakeBlueprint : public SimpleLeafBlueprint
{
private:
vespalib::string _tag;
vespalib::string _term;
FieldSpec _field;
FakeResult _result;
protected:
SearchIterator::UP
createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override;
public:
FakeBlueprint(const FieldSpec &field, const FakeResult &result);
~FakeBlueprint();
FakeBlueprint &tag(const vespalib::string &t) {
_tag = t;
return *this;
}
const vespalib::string &tag() const { return _tag; }
FakeBlueprint &term(const vespalib::string &t) {
_term = t;
return *this;
}
};
//-----------------------------------------------------------------------------
}
|