Files
faiss/c_api/IndexShards_c.h
Binozo c5ddbc7104 c_api: fix IndexShards own_indices getter/setter name mismatch (#5165)
Summary:
`IndexShards_c.cpp` defines:

```cpp
DEFINE_GETTER(IndexShards, int, own_indices)
DEFINE_SETTER(IndexShards, int, own_indices)
```

while `IndexShards_c.h` defines
```cpp
FAISS_DECLARE_GETTER_SETTER(IndexShards, int, own_fields)
```

this mismatch causes neither `faiss_IndexShards_set_own_indices` and `faiss_IndexShards_set_own_fields` to be exported in the c_api. This patch completes the migration to `indices` instead of `fields` in the c_api.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/5165

Reviewed By: mnorris11

Differential Revision: D103238014

Pulled By: trang-nm-nguyen

fbshipit-source-id: 5a972cc6b6611088f06e3388677e0cd10d9037c0
2026-04-30 14:16:29 -07:00

46 lines
1.1 KiB
C

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// -*- c++ -*-
#ifndef INDEXSHARDS_C_H
#define INDEXSHARDS_C_H
#include "Index_c.h"
#include "faiss_c.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Index that concatenates the results from several sub-indexes
*/
FAISS_DECLARE_CLASS_INHERITED(IndexShards, Index)
FAISS_DECLARE_DESTRUCTOR(IndexShards)
FAISS_DECLARE_GETTER_SETTER(IndexShards, int, own_indices)
FAISS_DECLARE_GETTER_SETTER(IndexShards, int, successive_ids)
int faiss_IndexShards_new(FaissIndexShards** p_index, idx_t d);
int faiss_IndexShards_new_with_options(
FaissIndexShards** p_index,
idx_t d,
int threaded,
int successive_ids);
int faiss_IndexShards_add_shard(FaissIndexShards* index, FaissIndex* shard);
int faiss_IndexShards_remove_shard(FaissIndexShards* index, FaissIndex* shard);
FaissIndex* faiss_IndexShards_at(FaissIndexShards* index, int i);
#ifdef __cplusplus
}
#endif
#endif