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:
@@ -1,39 +1,47 @@
|
||||
#ifndef SEARCH_MATCH_H
|
||||
#define SEARCH_MATCH_H
|
||||
|
||||
#include <deque>
|
||||
#include <ostream>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "data/graph/Node.h"
|
||||
#include "data/query/QueryNode.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
struct SearchMatch
|
||||
{
|
||||
enum SearchType
|
||||
{
|
||||
SEARCH_NONE,
|
||||
SEARCH_TOKEN,
|
||||
SEARCH_COMMAND,
|
||||
SEARCH_OPERATOR
|
||||
};
|
||||
|
||||
static void log(const std::vector<SearchMatch>& matches, const std::string& query);
|
||||
static std::deque<SearchMatch> stringDequeToSearchMatchDeque(const std::deque<std::string>& deque);
|
||||
static std::deque<std::string> searchMatchDequeToStringDeque(const std::deque<SearchMatch>& deque);
|
||||
static std::string searchMatchDequeToString(const std::deque<SearchMatch>& deque);
|
||||
|
||||
static std::string getSearchTypeName(SearchType type);
|
||||
static std::string searchMatchesToString(const std::vector<SearchMatch>& matches);
|
||||
|
||||
SearchMatch();
|
||||
SearchMatch(const std::string& query);
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
void print(std::ostream& ostream) const;
|
||||
|
||||
std::string encodeForQuery() const;
|
||||
|
||||
void decodeFromQuery(std::string query);
|
||||
std::string getNodeTypeAsString() const;
|
||||
std::string getSearchTypeName() const;
|
||||
|
||||
std::string fullName;
|
||||
std::string typeName;
|
||||
|
||||
Node::NodeType nodeType;
|
||||
QueryNode::QueryNodeType queryNodeType;
|
||||
SearchType searchType;
|
||||
|
||||
std::set<Id> tokenIds;
|
||||
|
||||
std::vector<size_t> indices;
|
||||
size_t weight;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user