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

#pragma once

#include "wand_parts.h"
#include <vespa/searchlib/queryeval/searchiterator.h>

namespace search::queryeval {

struct WeakAndSearch : SearchIterator {
    using Terms = wand::Terms;
    using MatchParams = wand::MatchParams;
    virtual size_t get_num_terms() const = 0;
    virtual int32_t get_term_weight(size_t idx) const = 0;
    virtual wand::score_t get_max_score(size_t idx) const = 0;
    virtual const Terms &getTerms() const = 0;
    virtual uint32_t getN() const = 0;
    void visitMembers(vespalib::ObjectVisitor &visitor) const override;
    template<typename Scorer>
    static SearchIterator::UP createArrayWand(const Terms &terms, const MatchParams & matchParams,
                                              const Scorer & scorer, uint32_t n, bool strict);
    template<typename Scorer>
    static SearchIterator::UP createHeapWand(const Terms &terms, const MatchParams & matchParams,
                                             const Scorer & scorer, uint32_t n, bool strict);
    template<typename Scorer>
    static SearchIterator::UP create(const Terms &terms, const MatchParams & matchParams,
                                     const Scorer & scorer, uint32_t n, bool strict);
    static SearchIterator::UP create(const Terms &terms, const MatchParams & matchParams,
                                     uint32_t n, bool strict);
};

}