faiss/c_api
Matthijs Douze dd814b5f14 IVF filtering based on IDSelector (no init split) (#2483)
Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/2483

This diff changes the following:
1. all search functions now take a `SearchParameters` argument that overrides the internal search parameters
2. the default implementation for most classes throws when the params argument is non-nullptr / non-None
3. the IndexIVF and IndexHNSW classes have functioning SearchPArameters
4. the SearchParameters includes an IDSelector that can search only in a subset of the index based on a defined subset of ids

There is also some refactoring: the IDSelector was moved to its own .h/.cpp and python/__init__.py is spit in parts.

The diff is quite bulky because the search function prototypes need to be changed in all index classes.

Things to fix in subsequent diffs:

- support SearchParameters for more index types (Flat variants)

- better sub-object ownership for SearchParams (with std::unique_ptr?)

- special handling of IDSelectorRange to make it faster

Reviewed By: alexanderguzhva

Differential Revision: D39852589

fbshipit-source-id: 4988bdb5b9bee1207cd327d3f80bf5e0e2467fe1
2022-09-30 06:40:03 -07:00
..
gpu Remove redundant c_api headers while installing (#1841) 2021-04-26 02:20:23 -07:00
impl IVF filtering based on IDSelector (no init split) (#2483) 2022-09-30 06:40:03 -07:00
utils Add faiss_pairwise_L2sqr_with_defaults into C_API (#2067) 2021-10-07 03:43:57 -07:00
AutoTune_c.cpp
AutoTune_c.h
CMakeLists.txt Summary: Add Binary Index i.o to c_api (#2233) 2022-03-16 03:28:46 -07:00
Clustering_c.cpp C_API: Improve PreTransformIndex (#1945) 2021-06-23 07:06:20 -07:00
Clustering_c.h C_API: Improve PreTransformIndex (#1945) 2021-06-23 07:06:20 -07:00
INSTALL.md docs: Improve readability (#2378) 2022-07-08 09:19:07 -07:00
IndexBinary_c.cpp Summary: Add Binary Index i.o to c_api (#2233) 2022-03-16 03:28:46 -07:00
IndexBinary_c.h Summary: Add Binary Index i.o to c_api (#2233) 2022-03-16 03:28:46 -07:00
IndexFlat_c.cpp IndexFlatCodes: a single parent for all flat codecs (#2132) 2021-12-07 01:31:07 -08:00
IndexFlat_c.h C_API: Improve PreTransformIndex (#1945) 2021-06-23 07:06:20 -07:00
IndexIVFFlat_c.cpp
IndexIVFFlat_c.h
IndexIVF_c.cpp Cover more types for C_API (#1917) 2021-06-08 15:34:05 -07:00
IndexIVF_c.h Cover more types for C_API (#1917) 2021-06-08 15:34:05 -07:00
IndexLSH_c.cpp IndexFlatCodes: a single parent for all flat codecs (#2132) 2021-12-07 01:31:07 -08:00
IndexLSH_c.h IndexFlatCodes: a single parent for all flat codecs (#2132) 2021-12-07 01:31:07 -08:00
IndexPreTransform_c.cpp C_API: Improve PreTransformIndex (#1945) 2021-06-23 07:06:20 -07:00
IndexPreTransform_c.h C_API: Improve PreTransformIndex (#1945) 2021-06-23 07:06:20 -07:00
IndexReplicas_c.cpp Improve meta indexes (#1982) 2021-09-08 10:02:47 -07:00
IndexReplicas_c.h Improve meta indexes (#1982) 2021-09-08 10:02:47 -07:00
IndexScalarQuantizer_c.cpp
IndexScalarQuantizer_c.h
IndexShards_c.cpp Improve meta indexes (#1982) 2021-09-08 10:02:47 -07:00
IndexShards_c.h Improve meta indexes (#1982) 2021-09-08 10:02:47 -07:00
Index_c.cpp Add sa_code_size, sa_encode, and sa_decode to the C_API (#2367) 2022-06-29 12:02:51 -07:00
Index_c.h fix typo (#2479) 2022-09-20 03:03:30 -07:00
MetaIndexes_c.cpp Improve meta indexes (#1982) 2021-09-08 10:02:47 -07:00
MetaIndexes_c.h Improve meta indexes (#1982) 2021-09-08 10:02:47 -07:00
VectorTransform_c.cpp Impl IndexPreTransform for c_api (#1816) 2021-04-22 05:27:36 -07:00
VectorTransform_c.h Classes inherited from VectorTransform for c_api (#1869) 2021-05-12 07:34:39 -07:00
clone_index_c.cpp
clone_index_c.h
error_c.h
error_impl.cpp
error_impl.h
example_c.c Update example_c.c (#2419) 2022-08-31 05:44:25 -07:00
faiss_c.h
index_factory_c.cpp
index_factory_c.h
index_io_c.cpp Summary: Add Binary Index i.o to c_api (#2233) 2022-03-16 03:28:46 -07:00
index_io_c.h Summary: Add Binary Index i.o to c_api (#2233) 2022-03-16 03:28:46 -07:00
macros_impl.h