1 .. _notmuch-reindex(1):
10 **notmuch** **reindex** [*option* ...] <*search-term*> ...
15 Re-index all messages matching the search terms.
17 See :any:`notmuch-search-terms(7)` for details of the supported syntax for
20 The **reindex** command searches for all messages matching the
21 supplied search terms, and re-creates the full-text index on these
22 messages using the supplied options.
24 Supported options for **reindex** include
26 ``--decrypt=(true|nostash|auto|false)``
27 If ``true``, when encountering an encrypted message, try to
28 decrypt it while reindexing, stashing any session keys discovered.
29 If ``auto``, and notmuch already knows about a session key for the
30 message, it will try decrypting using that session key but will
31 not try to access the user's secret keys. If decryption is
32 successful, index the cleartext itself.
34 ``nostash`` is the same as ``true`` except that it will not stash
35 newly-discovered session keys in the database.
37 If ``false``, notmuch reindex will also delete any stashed session
38 keys for all messages matching the search terms.
40 Be aware that the index is likely sufficient (and a stashed
41 session key is certainly sufficient) to reconstruct the cleartext
42 of the message itself, so please ensure that the notmuch message
43 index is adequately protected. DO NOT USE ``--decrypt=true`` or
44 ``--decrypt=nostash`` without considering the security of your
47 See also ``index.decrypt`` in :any:`notmuch-config(1)`.
52 A user just received an encrypted message without indexing its
53 cleartext. After reading it (via ``notmuch show --decrypt=true``),
54 they decide that they want to index its cleartext so that they can
55 easily find it later and read it without having to have access to
60 notmuch reindex --decrypt=true id:1234567@example.com
62 A user wants to change their policy going forward to start indexing
63 cleartext. But they also want indexed access to the cleartext of all
64 previously-received encrypted messages. Some messages might have
65 already been indexed in the clear (as in the example above). They can
66 ask notmuch to just reindex the not-yet-indexed messages:
70 notmuch config set index.decrypt true
71 notmuch reindex tag:encrypted and not property:index.decryption=success
73 Later, the user changes their mind, and wants to stop indexing
74 cleartext (perhaps their threat model has changed, or their trust in
75 their index store has been shaken). They also want to clear all of
76 their old cleartext from the index. Note that they compact the
77 database afterward as a workaround for
78 https://trac.xapian.org/ticket/742:
82 notmuch config set index.decrypt false
83 notmuch reindex property:index.decryption=success
90 :any:`notmuch-compact(1)`,
91 :any:`notmuch-config(1)`,
92 :any:`notmuch-count(1)`,
93 :any:`notmuch-dump(1)`,
94 :any:`notmuch-hooks(5)`,
95 :any:`notmuch-insert(1)`,
96 :any:`notmuch-new(1)`,
97 :any:`notmuch-reply(1)`,
98 :any:`notmuch-restore(1)`,
99 :any:`notmuch-search(1)`,
100 :any:`notmuch-search-terms(7)`,
101 :any:`notmuch-show(1)`,
102 :any:`notmuch-tag(1)`