aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/queryeval/dot_product_search.h
blob: 34e288979e0a96a35dab6317a617e636018eafca (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "multisearch.h"
#include <vespa/vespalib/util/priority_queue.h>
#include <vespa/searchlib/fef/matchdata.h>
#include <vespa/searchlib/fef/termfieldmatchdataarray.h>
#include <vespa/searchlib/attribute/iterator_pack.h>

namespace search::fef { class TermFieldMatchData; }

namespace search::queryeval {

/**
 * Search iterator for a sparse dot product, based on a set of child
 * search iterators.
 *
 * This class is a base class for a set of different instantiations of
 * DotProductSearchImpl, defined in the .cpp-file.
 */
class DotProductSearch : public SearchIterator
{
protected:
    DotProductSearch() {}

public:
    // TODO: use MultiSearch::Children to pass ownership
    static SearchIterator::UP create(const std::vector<SearchIterator*> &children,
                                     search::fef::TermFieldMatchData &tmd,
                                     bool field_is_filter,
                                     const std::vector<fef::TermFieldMatchData*> &childMatch,
                                     const std::vector<int32_t> &weights,
                                     fef::MatchData::UP md);

    static SearchIterator::UP create(search::fef::TermFieldMatchData &tmd,
                                     bool field_is_filter,
                                     const std::vector<int32_t> &weights,
                                     std::vector<DocumentWeightIterator> &&iterators);
};

}