[search] Don't match categories against empty prefix.

This commit is contained in:
Yury Melnichek 2011-06-03 21:37:23 +02:00 committed by Alex Zolotarev
parent cb92f6b644
commit 2e1005f3b2

View file

@ -116,8 +116,10 @@ void Query::Search(function<void (Result const &)> const & f)
}
// Category matching.
if (!m_prefix.empty())
{
KeywordMatcher matcher = MakeMatcher(m_keywords, m_prefix);
KeywordMatcher matcher = MakeMatcher(vector<strings::UniString>(), m_prefix);
LOG(LINFO, (m_prefix));
matcher.ProcessNameToken("", strings::MakeUniString("restaurant"));
uint32_t const matchScore = matcher.GetMatchScore();
if (matcher.GetPrefixMatchScore() <= GetMaxPrefixMatchScore(m_prefix.size()) &&