logic: Fulltextsearch

* fulltextsearch enabled in sqlite
* fulltextsearch start search with @
* codeview performance improved
* strip sRGB profile from png files to get rid of libpng warning at runtime
This commit is contained in:
Andreas Stallinger
2016-05-10 11:10:13 +02:00
parent 30faa7e52f
commit e775ae1ecd
84 changed files with 455 additions and 111 deletions
+7 -2
View File
@@ -9,6 +9,7 @@
#include "utility/file/FileInfo.h"
#include "utility/file/FilePath.h"
#include "data/parser/ParseLocation.h"
#include "data/graph/Node.h"
#include "data/search/SearchMatch.h"
#include "data/ErrorCountInfo.h"
@@ -36,6 +37,8 @@ public:
virtual NameHierarchy getNameHierarchyForNodeWithId(Id id) const = 0;
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const = 0;
virtual std::shared_ptr<TokenLocationCollection> getFullTextSearchLocations(
const std::string& searchTerm) const = 0;
virtual std::vector<SearchMatch> getAutocompletionMatches(const std::string& query) const = 0;
virtual std::vector<SearchMatch> getSearchMatchesForTokenIds(const std::vector<Id>& tokenIds) const = 0;
@@ -51,8 +54,10 @@ public:
virtual Id getTokenIdForFileNode(const FilePath& filePath) const = 0;
virtual std::vector<Id> getTokenIdsForAggregationEdge(Id sourceId, Id targetId) const = 0;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForTokenIds(const std::vector<Id>& tokenIds) const = 0;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForLocationIds(const std::vector<Id>& locationIds) const = 0;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForTokenIds(
const std::vector<Id>& tokenIds) const = 0;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForLocationIds(
const std::vector<Id>& locationIds) const = 0;
virtual std::shared_ptr<TokenLocationFile> getTokenLocationsForFile(const std::string& filePath) const = 0;
virtual std::shared_ptr<TokenLocationFile> getTokenLocationsForLinesInFile(
const std::string& filePath, uint firstLineNumber, uint lastLineNumber) const = 0;
+15 -2
View File
@@ -93,6 +93,17 @@ std::vector<SearchMatch> StorageAccessProxy::getAutocompletionMatches(const std:
return std::vector<SearchMatch>();
}
std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getFullTextSearchLocations(
const std::string &searchTerm) const
{
if (hasSubject())
{
return m_subject->getFullTextSearchLocations(searchTerm);
}
return std::make_shared<TokenLocationCollection>();
}
std::vector<SearchMatch> StorageAccessProxy::getSearchMatchesForTokenIds(const std::vector<Id>& tokenIds) const
{
if (hasSubject())
@@ -183,7 +194,8 @@ std::vector<Id> StorageAccessProxy::getTokenIdsForAggregationEdge(Id sourceId, I
return std::vector<Id>();
}
std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getTokenLocationsForTokenIds(const std::vector<Id>& tokenIds) const
std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getTokenLocationsForTokenIds(
const std::vector<Id>& tokenIds) const
{
if (hasSubject())
{
@@ -193,7 +205,8 @@ std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getTokenLocationsFo
return std::make_shared<TokenLocationCollection>();
}
std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getTokenLocationsForLocationIds(const std::vector<Id>& locationIds) const
std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getTokenLocationsForLocationIds(
const std::vector<Id>& locationIds) const
{
if (hasSubject())
{
+7 -2
View File
@@ -22,6 +22,7 @@ public:
virtual NameHierarchy getNameHierarchyForNodeWithId(Id id) const;
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const;
virtual std::shared_ptr<TokenLocationCollection> getFullTextSearchLocations(const std::string& searchTerm) const;
virtual std::vector<SearchMatch> getAutocompletionMatches(const std::string& query) const;
virtual std::vector<SearchMatch> getSearchMatchesForTokenIds(const std::vector<Id>& tokenIds) const;
@@ -37,8 +38,12 @@ public:
virtual Id getTokenIdForFileNode(const FilePath& filePath) const;
virtual std::vector<Id> getTokenIdsForAggregationEdge(Id sourceId, Id targetId) const;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForTokenIds(const std::vector<Id>& tokenIds) const;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForLocationIds(const std::vector<Id>& locationIds) const;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForTokenIds(
const std::vector<Id>& tokenIds
) const;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForLocationIds(
const std::vector<Id>& locationIds
) const;
virtual std::shared_ptr<TokenLocationFile> getTokenLocationsForFile(const std::string& filePath) const;
virtual std::shared_ptr<TokenLocationFile> getTokenLocationsForLinesInFile(
const std::string& filePath, uint firstLineNumber, uint lastLineNumber