From 2af263f910968351e4ff4f68f21e30cac24ff943 Mon Sep 17 00:00:00 2001 From: Sanhaoji2 Date: Tue, 25 Nov 2025 13:56:48 +0800 Subject: [PATCH] ignore invalid label --- src/index.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.cpp b/src/index.cpp index 030238281..f18b9966f 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2509,7 +2509,10 @@ std::pair Index::_search_with_filters(const for (const auto &raw_label : raw_labels) { auto converted_label = this->get_converted_label(raw_label); - converted_labels.push_back(converted_label); + if (converted_label != std::numeric_limits::max()) + { + converted_labels.push_back(converted_label); + } } if (typeid(uint64_t *) == indices.type())