logic: preselecting SearchNodes for autocompletion by prefiltering the Graph with the entered Query
This change only shows matches in the autocompletion list that are prefiltered by the already entered query. The autocompletion now also shows up after an operator of type . or > has been entered to show an alphabetical list of possible tokens.
This commit is contained in:
@@ -16,7 +16,8 @@ public:
|
||||
|
||||
virtual Id getIdForNodeWithName(const std::string& name) const = 0;
|
||||
virtual std::string getNameForNodeWithId(Id id) const = 0;
|
||||
virtual std::vector<SearchIndex::SearchMatch> getAutocompletionMatches(const std::string& query) const = 0;
|
||||
virtual std::vector<SearchIndex::SearchMatch> getAutocompletionMatches(
|
||||
const std::string& query, const std::string& word) const = 0;
|
||||
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const = 0;
|
||||
|
||||
|
||||
@@ -47,11 +47,13 @@ std::string GraphAccessProxy::getNameForNodeWithId(Id id) const
|
||||
return "";
|
||||
}
|
||||
|
||||
std::vector<SearchIndex::SearchMatch> GraphAccessProxy::getAutocompletionMatches(const std::string& query) const
|
||||
{
|
||||
std::vector<SearchIndex::SearchMatch> GraphAccessProxy::getAutocompletionMatches(
|
||||
const std::string& query,
|
||||
const std::string& word
|
||||
) const {
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getAutocompletionMatches(query);
|
||||
return m_subject->getAutocompletionMatches(query, word);
|
||||
}
|
||||
|
||||
return std::vector<SearchIndex::SearchMatch>();
|
||||
|
||||
@@ -15,7 +15,8 @@ public:
|
||||
// GraphAccess implementation
|
||||
virtual Id getIdForNodeWithName(const std::string& name) const;
|
||||
virtual std::string getNameForNodeWithId(Id id) const;
|
||||
virtual std::vector<SearchIndex::SearchMatch> getAutocompletionMatches(const std::string& query) const;
|
||||
virtual std::vector<SearchIndex::SearchMatch> getAutocompletionMatches(
|
||||
const std::string& query, const std::string& word) const;
|
||||
|
||||
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user