src: removed query syntax
This change removes the query syntax from the QtSmartSearchbox and all its classes. Now it only autocompletes to one single Token, but the UI functionality for composing a query of multiple elements is still left for later use. The struct SearchMatch is now used in the whole pipeline for passing search results back and forth.
This commit is contained in:
@@ -5,8 +5,9 @@ void StorageCache::clear()
|
||||
m_queryToTokenIds.clear();
|
||||
}
|
||||
|
||||
std::vector<Id> StorageCache::getTokenIdsForQuery(std::string query) const
|
||||
std::vector<Id> StorageCache::getTokenIdsForMatches(const std::vector<SearchMatch>& matches) const
|
||||
{
|
||||
std::string query = SearchMatch::searchMatchesToString(matches);
|
||||
std::map<std::string, std::vector<Id>>::const_iterator it = m_queryToTokenIds.find(query);
|
||||
|
||||
if (it != m_queryToTokenIds.end())
|
||||
@@ -14,7 +15,7 @@ std::vector<Id> StorageCache::getTokenIdsForQuery(std::string query) const
|
||||
return it->second;
|
||||
}
|
||||
|
||||
std::vector<Id> ids = StorageAccessProxy::getTokenIdsForQuery(query);
|
||||
std::vector<Id> ids = StorageAccessProxy::getTokenIdsForMatches(matches);
|
||||
|
||||
m_queryToTokenIds.emplace(query, ids);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user