aboutsummaryrefslogtreecommitdiffstats
path: root/core/fulltext.h
AgeCommit message (Collapse)Author
2020-09-29fulltext: remember original queryGravatar Berthold Stoeger
So far, the fulltext-query structure only saves an canonicalized upper-cased version of the query. However, if we want to save the fulltext query to the log (filter presets) or want to restore an old fulltext query, we have to store the original query. We don't want to confront the user with the mangled upper-cased version. Therefore, also save the original version. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-08fulltext: rename fulltext_reload() to fulltext_populate()Gravatar Berthold Stoeger
This function was named improperly: it was only used on freshly loaded data. Indeed, attempts to use it to actually reload lead to crashes. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: compile fulltext index on mobileGravatar Berthold Stoeger
The code is not used yet. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-01filter: add fulltext filtering codeGravatar Berthold Stoeger
Add code that indexes all words of a dive and provides searching for words. A query is represented by the FullTextQuery class, which can be initialized by assigning a string to it. It is basically a list of words. The result of a search is stored in the FullTextResult class, which is a list of dives. The actual indexing and searching is implemented in the FullText class. However, this class is not exported because the interface is partially accessible to C. Notably, the reloading of the fulltext index is done from the C core. Currently, the indexing and searching is totally unoptimized. In a ~4000 dives test-log searches typically took single-digit ms times. There is ample room for optimization (e.g. when searching for multiple words, chose the words with few dives first and when down to a few dives, check them individually). The words of each dive are tokenized and uppercased and cached with the dive. A pointer to these words is stashed in the dive structure. For now, compile only on desktop. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>