Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the disparity between disk and memory search for Universal label #347

Merged
merged 9 commits into from
May 24, 2023
14 changes: 11 additions & 3 deletions src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,17 @@ std::pair<uint32_t, uint32_t> Index<T, TagT, LabelT>::iterate_to_fixed_point(
std::back_inserter(common_filters));
if (_use_universal_label)
{
if (std::find(filter_label.begin(), filter_label.end(), _universal_label) != filter_label.end() ||
std::find(x.begin(), x.end(), _universal_label) != x.end())
common_filters.emplace_back(_universal_label);
if (!search_invocation)
{
if (std::find(filter_label.begin(), filter_label.end(), _universal_label) != filter_label.end() ||
std::find(x.begin(), x.end(), _universal_label) != x.end())
common_filters.emplace_back(_universal_label);
}
else
{
if (std::find(x.begin(), x.end(), _universal_label) != x.end())
common_filters.emplace_back(_universal_label);
}
}

if (common_filters.size() == 0)
Expand Down