data: increased autocomplete performance by caching and limiting results to 100
This commit is contained in:
@@ -15,7 +15,7 @@ std::vector<SearchMatch> SearchIndex::getMatches(
|
||||
|
||||
for (SearchResultsIterator it = searchResults.begin(); it != searchResults.end(); it++)
|
||||
{
|
||||
SearchMatch match = it->node->fuzzyMatchData(query, it->parent);
|
||||
SearchMatch match = it->node->fuzzyMatchData(query, it->parent->getParent());
|
||||
result.push_back(match);
|
||||
}
|
||||
|
||||
@@ -171,6 +171,11 @@ SearchResults SearchIndex::runFuzzySearch(const std::string& query) const
|
||||
return m_root.runFuzzySearch(query);
|
||||
}
|
||||
|
||||
SearchResults SearchIndex::runFuzzySearchCached(const std::string& query, const SearchResults& searchResults) const
|
||||
{
|
||||
return m_root.runFuzzySearchCached(query, searchResults);
|
||||
}
|
||||
|
||||
std::vector<SearchMatch> SearchIndex::runFuzzySearchAndGetMatches(const std::string& query) const
|
||||
{
|
||||
return getMatches(runFuzzySearch(query), query);
|
||||
|
||||
Reference in New Issue
Block a user