blob: 9f0642070af9fd4e640f2b2cf90415573a50150e (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "searchable.h"
#include "leaf_blueprints.h"
#include "intermediate_blueprints.h"
namespace search::queryeval {
Blueprint::UP
Searchable::createBlueprint(const IRequestContext & requestContext,
const FieldSpecList &fields,
const search::query::Node &term)
{
if (fields.empty()) {
return std::make_unique<EmptyBlueprint>();
}
if (fields.size() == 1) {
return createBlueprint(requestContext, fields[0], term);
}
auto b = std::make_unique<OrBlueprint>();
for (size_t i = 0; i < fields.size(); ++i) {
b->addChild(createBlueprint(requestContext, fields[i], term));
}
return b;
}
}
|