blob: 4ce2a7c929922f8283c85cba31cb9a5e9bf16d1d (
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
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "matchdata.h"
namespace search {
namespace fef {
MatchData::MatchData(const Params &cparams)
: _termFields(cparams.numTermFields()),
_termwise_limit(1.0)
{
}
MatchData::UP
MatchData::makeTestInstance(uint32_t numTermFields, uint32_t fieldIdLimit)
{
MatchData::UP data(new MatchData(Params().numTermFields(numTermFields)));
for (uint32_t i = 0; i < numTermFields; ++i) {
data->resolveTermField(i)->setFieldId(i % fieldIdLimit);
}
return data;
}
} // namespace fef
} // namespace search
|