The SQLite tokeniser does not deal with scripts that do not use spaces
for word breaking (CJK, Thai, etc), thus searching in those languages
does not work well.
This adds a custom SQLite tokeniser based on ICU that breaks words for
all languages supported by that library, and uses NFKC_Casefold
normalisation to handle normalisation, case folding, and dropping of
ignorable characters.
Fixes#121
When a user types in the search box, there may still be oustanding
FillWindowOperations queued on previous instances of SearchFolder
from previous keystrokes. This can result in a FillWindowOperation
with a stale value of ConversationMonitor.window_lowest from a previous
search executing on the current one. Detect this and return immediately.
Fixes: #838
This does the following:
* Makes updating the search query a non-async call, so that apps can
call it and forget about it
* Makes updating search results only update the folder's contents
when finished, and not if cancelled
* Cancels any existing search tasks if the query is updated
* Swaps sending removed signals before inserted signals to make the
conversation viewer happier
Ensure OR is actually used to separate disjuncts, don't prefix match
non-stemmed terms when a stemmed version exists or when EXACT is
specified. Ensure column is correctly specified per disjunct.
SQLite FTS5 doesn't allow all negated terms in matches, and since NOT
is a binary operator (rather than unary) negated terms should be listed
after any positive terms.
Move SQL generation for FTS search from ImapDb.Account to SearchQuery.
Convert to use Geary.SearchQuery.Term instances to generate SQL, rather
than parsing the expression. Simplify the generated SQL substantially
and generate MATCH values that work with SQLite FTS5.
Adds classes that allow building arbitrary query expressions and require
an instance to be provided to Geary.SearchQuery, to be set as a
property.
This enables query expressions to be parsed by clients instead of the
engine, in which ever whay they choose.
Add SQL migration that drops the old FTS4 MessageSearchTable table,
re-create as a FTS5 table, clean up the column names a bit, and adds a
flags column so unread/starred queries can be made fast.
Define a SQLite FTS5 extension function `geary_matches()` to replace
the FTS3 `offsets()` function which no longer exists in FTS5, based on
Tracker's implementation.
Update code to FTS5 conventions (docid -> rowid, etc), use new column
names, populate and update the flags column as the email's flags
change, and use new match function for getting matching tokens.
Advanced searches are probably currently broken, these will be fixed
by subsequent commits.
Since WebKitGTK does not currently support printing under Flatpak,
enable RW access to XDG downloads folder, so at least people can print
to a PDF, then print that.
See https://github.com/flathub/org.gnome.Geary/issues/42
Now that vala only notifies on property changes when the value actually
changes, and GLib emits a warning when connecting to notify signals for
properties that don't exist, it's safer to use notify signals for
property changes, and hence this isn't needed any more.
This patch removes the signal, ensures the `has_selection` gets set
correctly, and updates signal listeners to use notify instead.
Fixes#1058, #1118 and possibly others.