7.4 Other search functionality

7.4.2 Narrowing search results

It can be useful to narrow existing search results, that is, to add some clauses to the current query to match fewer messages.

For example, suppose you’re looking at some mailing list, perhaps by jumping to a maildir (M-x mu4e-headers-jump-to-maildir, j) or because you followed some bookmark (M-x mu4e-search-bookmark, b). Now, you want to narrow things down to only those messages that have attachments.

This is when M-x mu4e-search-narrow (/) comes in handy. It asks for an additional search pattern, which is appended to the current search query, in effect getting you the subset of the currently shown headers that also match this extra search pattern. \ takes you back to the previous query, so, effectively ‘widens’ the search. Technically, narrowing the results of query x with expression y implies doing a search (x) AND (y).

Note that messages that were not in your original search results because of mu4e-search-results-limit may show up in the narrowed query.

7.4.4 Skipping duplicates

Another useful feature is skipping of duplicate messages. When you have copies of messages, there’s usually little value in including more than one in search results. A common reason for having multiple copies of messages is the combination of Gmail and offlineimap, since that is the way the labels / virtual folders in Gmail are represented. You can enable skipping duplicates by setting mu4e-search-skip-duplicates to t, and you can toggle the value using P (mu4e-search-toggle-property).

Note, messages are considered duplicates when they have the same Message-Id.