summaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/fef/matchdatalayout.cpp
blob: 632bd4225814920eb16e9c2d8d94f147533c3500 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "matchdatalayout.h"
#include <cassert>

namespace search::fef {

MatchDataLayout::MatchDataLayout()
    : _fieldIds()
{
}

MatchDataLayout::~MatchDataLayout() = default;


MatchData::UP
MatchDataLayout::createMatchData() const
{
    auto md = std::make_unique<MatchData>(MatchData::params().numTermFields(_fieldIds.size()));
    for (size_t i = 0; i < _fieldIds.size(); ++i) {
        md->resolveTermField(i)->setFieldId(_fieldIds[i]);
    }
    return md;
}

}