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

#pragma once

#include <vespa/eval/eval/value_type.h>
#include <memory>

namespace search::attribute { class HnswIndexParams; }

namespace search::tensor {

class DocVectorAccess;
class NearestNeighborIndex;

/**
 * Factory interface used to instantiate an index used for (approximate) nearest neighbor search.
 */
class NearestNeighborIndexFactory {
public:
    virtual ~NearestNeighborIndexFactory() {}
    virtual std::unique_ptr<NearestNeighborIndex> make(const DocVectorAccess& vectors,
                                                       size_t vector_size,
                                                       bool multi_vector_index,
                                                       vespalib::eval::CellType cell_type,
                                                       const search::attribute::HnswIndexParams& params) const = 0;
};

}