diff --git a/faiss/IndexIDMap.cpp b/faiss/IndexIDMap.cpp index e093bbda83..dc84052b2f 100644 --- a/faiss/IndexIDMap.cpp +++ b/faiss/IndexIDMap.cpp @@ -146,9 +146,16 @@ void IndexIDMapTemplate::range_search( typename IndexT::distance_t radius, RangeSearchResult* result, const SearchParameters* params) const { - FAISS_THROW_IF_NOT_MSG( - !params, "search params not supported for this index"); - index->range_search(n, x, radius, result); + if (params) { + SearchParameters internal_search_parameters; + IDSelectorTranslated id_selector_translated(id_map, params->sel); + internal_search_parameters.sel = &id_selector_translated; + + index->range_search(n, x, radius, result, &internal_search_parameters); + } else { + index->range_search(n, x, radius, result); + } + #pragma omp parallel for for (idx_t i = 0; i < result->lims[result->nq]; i++) { result->labels[i] = result->labels[i] < 0 ? result->labels[i]