unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* v2 of libconfig, date:foo, and named query patches
@ 2016-03-26 17:57 David Bremner
  2016-03-26 17:57 ` [Patch v2 01/13] configure: autodetect xapian-1.3 David Bremner
                   ` (13 more replies)
  0 siblings, 14 replies; 38+ messages in thread
From: David Bremner @ 2016-03-26 17:57 UTC (permalink / raw)
  To: notmuch

Sorry for the long series, but there is a lot of moving parts here.  This obsoletes

      id:1458644094-13951-1-git-send-email-david@tethera.net

Since that series, the only code changes are a fix for the visibility
warning (see the bottom of the interdiff), essentially mimic more
closely Jani's date time range parser code. There are also a bunch of added docs.  I have no doubt there are improvements that could be made here, but I fixed all of the things I knew about (and I was sure was problems).

Patch 1 could be useful independently of the rest of the series, since
allows compiling with xapian 1.3 out of the box.

diff --git a/doc/man1/notmuch-config.rst b/doc/man1/notmuch-config.rst
index 98b3c1a..c3470a8 100644
--- a/doc/man1/notmuch-config.rst
+++ b/doc/man1/notmuch-config.rst
@@ -132,6 +132,12 @@ The available configuration items are described below.
     
         Default: ``gpg``.
 
+    **options.<name>**
+
+	Compile time option <name>. Current possibilities include
+	"compact" (see **notmuch-compact(1)**)
+	and "field_processor" (see **notmuch-search-terms(7)**).
+
     **query.<name>**
 
         Expansion for named query called <name>. See
diff --git a/doc/man1/notmuch-dump.rst b/doc/man1/notmuch-dump.rst
index a37c337..eda9e07 100644
--- a/doc/man1/notmuch-dump.rst
+++ b/doc/man1/notmuch-dump.rst
@@ -71,6 +71,23 @@ Supported options for **dump** include
             characters. Note also that tags with spaces will not be
             correctly restored with this format.
 
+    ``--include=(config|tags)``
+
+    Control what kind of metadata is included in the output.
+
+      **config**
+
+	Output configuration data stored in the database. Each line
+	starts with "#@ ", followed by a space seperated key-value
+	pair.  Both key and value are hex encoded if needed.
+
+      **tags**
+
+	Output per-message metadata, namely tags. See *format* above
+	for description of the output.
+
+      The default is to include both tags and configuration information
+
     ``--output=``\ <filename>
         Write output to given file instead of stdout.
 
diff --git a/doc/man1/notmuch-restore.rst b/doc/man1/notmuch-restore.rst
index 362e262..87fa22e 100644
--- a/doc/man1/notmuch-restore.rst
+++ b/doc/man1/notmuch-restore.rst
@@ -50,6 +50,24 @@ Supported options for **restore** include
             format, this heuristic, based the fact that batch-tag format
             contains no parentheses, should be accurate.
 
+    ``--include=(config|tags)``
+
+      Control what kind of metadata is restored.
+
+	**config**
+
+	  Restore configuration data to the database. Each configuration line starts
+	  with "#@ ", followed by a space seperated key-value pair.
+	  Both key and value are hex encoded if needed.
+
+	**tags**
+
+	  Output per-message metadata, namely tags. See *format* above
+	  for more details.
+
+      The default is to restore both tags and configuration
+      information
+
     ``--input=``\ <filename>
         Read input from given file instead of stdin.
 
diff --git a/doc/man7/notmuch-search-terms.rst b/doc/man7/notmuch-search-terms.rst
index 2fbc16d..7474f53 100644
--- a/doc/man7/notmuch-search-terms.rst
+++ b/doc/man7/notmuch-search-terms.rst
@@ -56,6 +56,8 @@ indicate user-supplied values):
 
 -  lastmod:<initial-revision>..<final-revision>
 
+-  query:<name>
+
 The **from:** prefix is used to match the name or address of the sender
 of an email message.
 
@@ -132,6 +134,11 @@ were added/removed or filenames changed).  This is usually used in
 conjunction with the **--uuid** argument to **notmuch search**
 to find messages that have changed since an earlier query.
 
+The **query:** prefix allows queries to refer to previously saved
+queries added with **notmuch-config(1)**. Named queries are only
+available if notmuch is built with **Xapian Field Processors** (see
+below).
+
 Operators
 ---------
 
@@ -281,9 +288,10 @@ matches from the beginning of January to the end of February.
 date:<expr>..! can be used as a shorthand for date:<expr>..<expr>. The
 expansion takes place before interpretation, and thus, for example,
 date:monday..! matches from the beginning of Monday until the end of
-Monday. (Note that entering date:<expr> without "..", for example
-date:yesterday, won't work, as it's not interpreted as a range
-expression at all. Again, use date:yesterday..!)
+Monday.
+With **Xapian Field Processor** support (see below), non-range
+date queries such as date:yesterday will work, but otherwise
+will give unexpected results; if in doubt use date:yesterday..!
 
 Currently, we do not support spaces in range expressions. You can
 replace the spaces with '\_', or (in most cases) '-', or (in some cases)
@@ -370,6 +378,22 @@ Time zones
 
 Some time zone codes, e.g. UTC, EET.
 
+XAPIAN FIELD PROCESSORS
+=======================
+
+Certain optional features of the notmuch query processor rely on the
+presence of the Xapian field processor API. You can determine if your
+notmuch was built against a sufficiently recent version of Xapian by running
+
+::
+
+  % notmuch config get options.field_processor
+
+Currently the following features require field processor support:
+
+- non-range date queries, e.g. "date:today"
+- named queries e.g. "query:my_special_query"
+
 SEE ALSO
 ========
 
diff --git a/lib/database-private.h b/lib/database-private.h
index f7c6f46..5ab4001 100644
--- a/lib/database-private.h
+++ b/lib/database-private.h
@@ -148,10 +148,6 @@ operator&=(_notmuch_features &a, _notmuch_features b)
 				    Xapian::QueryParser::FLAG_LOVEHATE | Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE | \
 				    Xapian::QueryParser::FLAG_WILDCARD | Xapian::QueryParser::FLAG_PURE_NOT)
 
-#if HAVE_XAPIAN_FIELD_PROCESSOR
-class DateFieldProcessor;
-class QueryFieldProcessor;
-#endif
 struct _notmuch_database {
     notmuch_bool_t exception_reported;
 
@@ -185,8 +181,8 @@ struct _notmuch_database {
     Xapian::ValueRangeProcessor *value_range_processor;
     Xapian::ValueRangeProcessor *date_range_processor;
 #if HAVE_XAPIAN_FIELD_PROCESSOR
-    DateFieldProcessor *date_field_processor;
-    QueryFieldProcessor *query_field_processor;
+    Xapian::FieldProcessor *date_field_processor;
+    Xapian::FieldProcessor *query_field_processor;
 #endif
     Xapian::ValueRangeProcessor *last_mod_range_processor;
 };

^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2016-05-01 17:49 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-26 17:57 v2 of libconfig, date:foo, and named query patches David Bremner
2016-03-26 17:57 ` [Patch v2 01/13] configure: autodetect xapian-1.3 David Bremner
2016-04-01  9:09   ` Tomi Ollila
2016-04-01 23:29   ` David Bremner
2016-03-26 17:57 ` [Patch v2 02/13] configure: detect Xapian:FieldProcessor David Bremner
2016-03-26 17:57 ` [Patch v2 03/13] lib: optionally support single argument date: queries David Bremner
2016-03-26 17:57 ` [Patch v2 04/13] lib/cli: add library API / CLI for compile time options David Bremner
2016-04-27 17:47   ` Tomi Ollila
2016-04-30 11:53     ` David Bremner
2016-05-01 17:48       ` Tomi Ollila
2016-03-26 17:57 ` [Patch v2 05/13] configure: check directly for xapian compaction API David Bremner
2016-03-26 17:57 ` [Patch v2 06/13] lib: provide config API David Bremner
2016-03-26 17:57 ` [Patch v2 07/13] lib: config list iterators David Bremner
2016-03-26 17:57 ` [Patch v2 08/13] CLI: add print_status_database David Bremner
2016-03-27 20:25   ` [PATCH] nmbug: ignore # comments David Bremner
2016-03-27 20:38     ` W. Trevor King
2016-03-28  7:14       ` Tomi Ollila
2016-03-28 12:33     ` David Bremner
2016-03-26 17:57 ` [Patch v2 09/13] CLI: add optional config data to dump output David Bremner
2016-03-26 18:13   ` David Bremner
2016-03-26 17:57 ` [Patch v2 10/13] CLI: optionally restore config data David Bremner
2016-03-26 17:57 ` [Patch v2 11/13] CLI: add notmuch-config support for named queries David Bremner
2016-03-26 17:57 ` [Patch v2 12/13] lib: make a global constant for query parser flags David Bremner
2016-03-26 17:57 ` [Patch v2 13/13] lib: add support for named queries David Bremner
2016-04-01 23:57 ` Breaking a really long thread David Mazieres
2016-04-02 12:41   ` David Bremner
2016-04-02 13:56     ` David Mazieres
2016-04-04 11:07       ` Eric
2016-04-04 13:00         ` Mark Walters
2016-04-04 15:38           ` Eric
2016-04-05  5:28           ` David Mazieres
2016-04-09 11:20             ` Daniel Kahn Gillmor
2016-04-09 18:55               ` David Bremner
2016-04-09 22:40                 ` Mark Walters
2016-04-11  2:05                   ` David Bremner
2016-04-11  7:19                     ` Mark Walters
2016-04-11  7:39                       ` David Edmondson
2016-04-11  9:57                         ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).