ui: integrated autocompletion and filtering into SearchView

- QtSearchView was split into QtSearchView and QtSearchBox.
- QtSearchBox contains all Qt elements and can use them purely
- QtSearchView forwards calls from the SearchController to QtSearchBox
- Searching is initiated with MessageSearch to the SearchController
- Autocompletion is initiated with MessageSearchAutocomplete to the SearchController
- The search field is able to create filter queries by only giving autocompletions for the last token in the query
- For named tokens the search field adds their token ids to the query in the form of "A,25" for faster lookup

bug id = #21
This commit is contained in:
Eberhard Graether
2014-09-11 14:53:03 +02:00
parent 760e5ffafd
commit fec7abbc9b
48 changed files with 786 additions and 391 deletions
+4 -10
View File
@@ -336,15 +336,11 @@ std::string Storage::getNameForNodeWithId(Id id) const
}
}
std::vector<std::string> Storage::getNamesForNodesWithNamePrefix(const std::string& prefix) const
std::vector<SearchIndex::SearchMatch> Storage::getAutocompletionMatches(const std::string& query) const
{
std::vector<std::string> names;
std::vector<SearchIndex::SearchMatch> matches = m_index.findFuzzyMatches(prefix);
for (const SearchIndex::SearchMatch& match : matches)
{
names.push_back(match.node->getFullName());
}
return names;
std::vector<SearchIndex::SearchMatch> matches = m_index.findFuzzyMatches(query);
SearchIndex::logMatches(matches, query);
return matches;
}
std::shared_ptr<Graph> Storage::getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const
@@ -444,8 +440,6 @@ std::vector<Id> Storage::getTokenIdsForQuery(std::string query) const
LOG_INFO_STREAM(<< '\n' << tree << '\n' << outGraph);
SearchIndex::logMatches(m_index.findFuzzyMatches(query), query);
return outGraph.getTokenIds();
}