Commit Graph

48 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 3e233cba9a rework logging system
reimplement the old mu-log.[ch] into mu-logging.{cc,hh}

If available (and using an appropriately equipped glib), log to the
systemd journal

Only g_criticals have stderr output, all the other g_* go to the log
file / journal.
2020-05-30 13:29:44 +03:00
Dirk-Jan C. Binnema 46ae663937 mu4e: use faster count queries, document differences
Use faster queries for counting read/unread messages; document why the
results might differ from what you get doing a normal search.
2020-03-15 01:23:01 +02:00
Dirk-Jan C. Binnema 20ce7b7066 lib/parser -> lib/query
And update the names to follow the mu- convention.
2020-02-20 21:53:48 +02:00
Dirk-Jan C. Binnema bdec1fe9c4 mu-query: implement mu_query_count_run
To get the number of matches and nothing else.
2020-01-22 11:42:15 +02:00
Dirk-Jan C. Binnema 97afdd9e3c lib: Use Mu:Error exception
Where applicable.
2020-01-01 13:25:07 +02:00
Dirk-Jan C. Binnema 9f93526884 move parser/utils to utils, Mux->Mu
Move the parser utils to utils/ and rename the Mux namespace into Mu.
2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema b55e191421 update for lib/utils split
Update sources with the new paths
2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema 83d6484f86 lib/mu-store: rework implementation
* mu-store.h, mu-store-read.cc, mu-store-write.cc, mu-store-priv.hh have been reworked
   in mu-store.{cc,hh}, it the mix of c/c++ improved
 * update all the dependent modules
 * make it easier to upgrade an database in place (without user intervention)
 * remove the xbatch-size option
2019-07-30 08:51:04 +03:00
Nicolas Avrutin eb9bfbb1ca Perform threading calculation on related set instead of entire result.
The current threading algorithm is applied to the entire result of a query, even
if maxnum is specified, and then the result of the threading algorithm is
truncated to maxnum. The improves threading results by returning the entire
thread even when only a single message makes it into the top maxnum results.

This commit applies the threading algorithm to the related message set of the
maxnum-truncated query result instead of to the entire query result. For a given
set of messages, the set of messages which will share threads with any of the
original messages is exactly the related message sets. Put another way, either
any messages returned by the original query but removed by the maxnum truncation
will also be returned by the related message query, or they would not have been
needed anyway because they would not be members of any visible thread.

To maintain backward compatibility and allow threading to be used without
including related messages, the related message set is found for the threading
calculation, but any messages which would not have matched the original query
are then pruned, resulting in a superset of the truncated query, but a subset of
the untruncated query.

This does not improve (or degrade) the run time of a threading calculation when
maxnum is not set, but significant improves it when maxnum is set by making it
scale (roughly) linearly in terms of maxnum. On a maildir with ~200k messages
and maxnum set to 500 (the default), the run time of a threading calculation is
lowered from ~1m to ~0.1s.

Perform threading calculation on related set instead of entire result.

The current threading algorithm is applied to the entire result of a query, even
if maxnum is specified, and then the result of the threading algorithm is
truncated to maxnum. The improves threading results by returning the entire
thread even when only a single message makes it into the top maxnum results.

This commit applies the threading algorithm to the related message set of the
maxnum-truncated query result instead of to the entire query result. For a given
set of messages, the set of messages which will share threads with any of the
original messages is exactly the related message sets. Put another way, either
any messages returned by the original query but removed by the maxnum truncation
will also be returned by the related message query, or they would not have been
needed anyway because they would not be members of any visible thread.

To maintain backward compatibility and allow threading to be used without
including related messages, the related message set is found for the threading
calculation, but any messages which would not have matched the original query
are then pruned, resulting in a superset of the truncated query, but a subset of
the untruncated query.

This does not improve (or degrade) the run time of a threading calculation when
maxnum is not set, but significant improves it when maxnum is set by making it
scale (roughly) linearly in terms of maxnum. On a maildir with ~200k messages
and maxnum set to 500 (the default), the run time of a threading calculation is
lowered from ~1m to ~0.1s.
2018-07-09 02:41:22 -04:00
djcb 620912c62b mu: support 'raw' query (internally)
Allow for passing 'raw' queries to xapian, without any parsing.
2017-12-03 22:16:32 +02:00
djcb d18e0a1d84 query: don't be too eager matching field names
only match shortcuts when the field length was 1.
2017-11-02 08:06:48 +02:00
djcb 6053c1ec1f mu: fix clang build
casting error
2017-10-30 08:25:43 +02:00
djcb 509500a9d2 server: update query processing
fix quoting issues with mu4e
2017-10-27 18:43:33 +03:00
djcb aa07c4a27c update commands for new query parser 2017-10-25 23:50:17 +03:00
djcb 5e9cafea59 integrate new query parser 2017-10-25 23:50:17 +03:00
djcb 78275278cf mu: fix some compiler warnings 2016-12-11 18:33:31 +02:00
Stig Brautaset e9c6568a57 mu: swap begin and end if begin is _numerically_ bigger than end
The old behaviour would compare the strings, so would swap the start and end
ranges if start was 3K and end was 2M.

Fixes: 964
2016-12-03 23:19:27 +00:00
djcb baebd53fb8 Fix a core dump under OpenBSD
Based on a patch by StAlphonsos
2015-03-06 00:12:34 +02:00
djcb 13bad9a889 * better error message for some broken queries 2013-09-07 09:43:33 +03:00
djcb 312c3a4b20 * cosmetic 2013-07-03 21:56:42 +03:00
djcb 13efc74793 * mu-query: better handle empty lhs/rhs in date intervals 2013-06-03 22:29:50 +03:00
djcb b136ca0411 * try harder to match special strings 2013-05-29 07:33:17 -07:00
djcb 5d069e786f * lib: updates for mu-msg-field / mu-str updates 2013-05-13 00:03:47 +03:00
djcb 5c95a1851d * lib: update comment 2013-05-04 14:14:58 +03:00
djcb 855e81db99 * update copyright years 2013-03-30 11:32:07 +02:00
djcb 70356a62f5 * mu-query/mu-msg-iter: when showing related message (--include-related),
favor the ones that were in the original set
2012-12-28 14:48:00 +02:00
djcb 12f307c1b3 * mu-query: no need for sorting the first query when we do the sorting later 2012-12-27 16:00:13 +02:00
djcb c6a4e8f9ad * mu-query: re-introduce MU_QUERY_FLAG_THREADS, and only calculate threads for
the _second_ query when doing an --include-related query
2012-12-27 11:09:05 +02:00
djcb e456998e7d * mu-query: create the query in a smarter way, which makes --include-related *much* faster 2012-12-26 10:12:25 +02:00
djcb c0a9102c6b * cosmetic 2012-12-25 19:43:06 +02:00
djcb 7856ac939e * mu-query: implement MU_QUERY_FLAG_INCLUDE_RELATED, make threading non-optional 2012-12-25 17:34:24 +02:00
djcb a287074f7b * match all fields in query with explicit prefix 2012-12-22 11:47:20 +02:00
djcb d6332f3cc8 * mu-query: minor updates 2012-12-20 23:37:04 +02:00
djcb 76adc694c0 * add basic support for skipping dups, unreadable messages in mu-msg-iter 2012-12-17 22:29:39 +02:00
djcb 2f9dd78bb0 * add query flags (which match msgiterflags) to mu_query_run, update callers 2012-12-16 15:08:34 +02:00
djcb 9c0ec479f5 * mu-query: update for mu-msg-iter updates 2012-12-16 14:18:22 +02:00
djcb ef1791ec7c * support single dates (shortcut for ranges) in queries (thanks to Eygene Ryabinkin) 2012-11-17 21:25:09 +02:00
djcb 412de6f4aa * mu: allow 'recip:' in queries as a shortcut for "to:foo OR cc:foo OR bcc:foo" 2012-10-25 12:28:55 +03:00
djcb 11ecc65109 * update (C) years 2012-10-24 11:42:57 +03:00
djcb bc90df6c53 * cosmetics / minor 2012-10-23 20:29:24 +03:00
djcb 48467099b5 * mu: add 'contact:' as an alias for to:/from:/cc:/bcc: 2012-10-17 18:35:23 +03:00
djcb 8ad01e4aa8 * lib: threading: pre-sort the threaded results, add some more comments 2012-10-17 17:59:33 +03:00
djcb 7b39d56c99 * mu-query.cc: fix cc10 2012-08-31 00:22:18 +03:00
djcb 93171a5b90 * lib: try to reopen database when it got updated from the outside (for guile) 2012-08-19 09:57:49 +03:00
djcb 9133750d24 * mu-str.c: fix bug in check_for_field 2012-06-12 11:55:59 +03:00
djcb 423a1d7140 * mu4e: use GStringChunk* for string normalization / escaping
- this should fix the rare bug for some non-Latin unicode blocks,
  simplify some code, and possibly improve performance a bit
2012-06-12 00:11:14 +03:00
djcb 20d858e464 * implement / document changing sort order and threading
- update the protocol a bit (mu4e-proc, mu-cmd-server)
  - provide the user-interface (mu4e-headers.el)
  - document it (mu4e.texi, mu-server.1)
  - some cosmetics (the other changes)
2012-06-10 11:19:51 +03:00
djcb 46f10cfde9 * refactoring: split src/ into mu/ and lib/ 2012-05-21 09:25:53 +03:00