diff --git a/search/pre_ranker.cpp b/search/pre_ranker.cpp index cea49b9ac7..711526d17c 100644 --- a/search/pre_ranker.cpp +++ b/search/pre_ranker.cpp @@ -78,8 +78,7 @@ void PreRanker::FillMissingFieldsInPreResults() unique_ptr ranks = make_unique(); unique_ptr popularityRanks = make_unique(); unique_ptr centers; - - m_pivotFeatures.SetPosition(m_params.m_accuratePivotCenter, m_params.m_scale); + bool pivotFeaturesInitialized = false; ForEach([&](PreRankerResult & r) { FeatureID const & id = r.GetId(); @@ -116,6 +115,11 @@ void PreRanker::FillMissingFieldsInPreResults() } else { + if (!pivotFeaturesInitialized) + { + m_pivotFeatures.SetPosition(m_params.m_accuratePivotCenter, m_params.m_scale); + pivotFeaturesInitialized = true; + } info.m_distanceToPivot = m_pivotFeatures.GetDistanceToFeatureMeters(id); } });