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