aboutsummaryrefslogtreecommitdiff
path: root/notmuch-search.c
Commit message (Collapse)AuthorAge
* removed unused variablesDirk Hohndel2010-04-23
| | | | | | trivial compiler warning fix Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
* notmuch search: Fix timezone of timestamp in --format=json outputCarl Worth2010-04-22
| | | | | This is one of those cases that I move love. Deleting code fixes a bug, (test suite now passes again).
* lib: Rename iterator functions to prepare for reverse iteration.Carl Worth2010-03-09
| | | | | | | | We rename 'has_more' to 'valid' so that it can function whether iterating in a forward or reverse direction. We also rename 'advance' to 'move_to_next' to setup parallel naming with the proposed functions 'move_to_first', 'move_to_last', and 'move_to_previous'.
* notmuch search: Use "thread" rather than "id" when formatting with JSONCarl Worth2010-02-23
| | | | | | | The text output uses thread:<foo>, (which is a syntax directly supported by "notmuch show"), so make the json output be "thread", "<foo>" rather than "id", "<foo>". This should help avoid confusion of thread IDs with message IDs, (which do use the "id" prefix in searches).
* Add an "--format=(json|text)" command-line option to both notmuch-search and ↵Scott Robinson2010-02-23
| | | | | | | | | | | | | notmuch-show. In the case of notmuch-show, "--format=json" also implies "--entire-thread" as the thread structure is implicit in the emitted document tree. As a coincidence to the implementation, multipart message ID numbers are now incremented with each part printed. This changes the previous semantics, which were unclear and not necessary related to the actual ordering of the message parts.
* notmuch search: Remove the chunked-searching hack.Carl Worth2009-11-23
| | | | | | | | | | | | | This was a poor workaround around the fact that the existing notmuch_threads_t object is implemented poorly. It's got a fine iterartor-based interface, but the implementation does all of the work up-front in _create rather than doing the work incrementally while iterating. So to start fixing this, first get rid of all the hacks we had working around this. This drops the --first and --max-threads options from the search command, (but hopefully nobody was using them anyway---notmuch.el certainly wasn't).
* search : Extend "intial burst" optimization to return all results by chunksCarl Worth2009-11-23
| | | | | | | | | | | This way, the user gets a steady (but bursty) stream of reults. We double the chunk size each time since each successive chunk has to redo work from all previous chunks. Of course, the overall time is thereby slower, as the price we pay for increased responsiveness. With a search returning about 17000 thread results I measured a total time of 48.8 seconds before this change and 58.4 seconds afterwards.
* Rename NOTMUCH_DATABASE_MODE_WRITABLE to NOTMUCH_DATABASE_MODE_READ_WRITECarl Worth2009-11-21
| | | | And correspondingly, READONLY to READ_ONLY.
* Permit opening the notmuch database in read-only mode.Chris Wilson2009-11-21
| | | | | | | | | We only rarely need to actually open the database for writing, but we always create a Xapian::WritableDatabase. This has the effect of preventing searches and like whilst updating the index. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Carl Worth <cworth@cworth.org>
* notmuch search: Avoid infinite stream of exceptions from "notmuch search"Carl Worth2009-11-18
| | | | | | That is, give a nice error message and exit if no search terms are provided. Thanks to Priit Laes <plaes@plaes.org> for reporting the error and providing an early version of the fix.
* TypsosIngmar Vanhassel2009-11-18
|
* notmuch search: Change default search order to be newest messages first.Carl Worth2009-11-17
| | | | | | | | | | | | | | | | | This is what most people want for a _search_ command. It's often different for actually reading mail in an inbox, (where it makes more sense to have results displayed in chronological order), but in such a case, ther user is likely using an interface that can simply pass the --sort=oldest-first option to "notmuch search". Here we're also change the sort enum from NOTMUCH_SORT_DATE and NOTMUCH_SORT_DATE_REVERSE to NOTMUCH_SORT_OLDEST_FIRST and NOTMUCH_SORT_NEWEST_FIRST. Similarly we replace the --reverse option to "notmuch search" with two options: --sort=oldest-first and --sort=newest-first. Finally, these changes are all tracked in the emacs interface, (which has no change in its behavior).
* notmuch search: Return first 100 results as quickly as possible.Carl Worth2009-11-17
| | | | | | | | | This is one of those cases where total time is not the metric of interest. We increase the total time of the search, (by doing some redundant work for the initial threads). But more significantly, we give the user *some* results nearly instantaneously, (so that the user might see the result of interest without ever even waiting for the complete results to come in).
* notmuch search: Add support for a --reverse option to reverse sort order.Carl Worth2009-11-12
| | | | | | | | | | | | | | Note that the difference between thread results in date order and thread results in reverse-date order is not simply a matter of reversing the final results. When sorting in date order, the threads are sorted by the oldest message in the thread. When sorting in reverse-date order, the threads are sorted by the newest message in the thread. This difference means that we might want an explicit option in the interface to reverse the order, (even though the default will be to display the inbox in date order and global searches in reverse-date order).
* notmuch search: Print the number of matched/total messages for each thread.Carl Worth2009-11-12
| | | | | | | | | | | | | | | | | | | Note that we don't print the number of *unread* messages, but instead the number of messages that matched the search terms. This is in keeping with our philosophy that the inbox is nothing more than a search view. If we search for messages with an inbox tag, then that's what we'll get a count of. (And if somebody does want to see unread counts, then they can search for the "unread" tag.) Getting the number of matched messages is really nice when doing historical searches. For example in a search like: notmuch search tag:sent (where the "sent" tag has been applied to all messages originating from the user's email address)---here it's really nice to be able to see a thread where the user just mentioned one point [1/13] vs. really getting involved in the discussion [10/29].
* notmuch search: Add --first and --max-threads options for incremental search.Carl Worth2009-11-12
| | | | | | | | | | | | | This time, things are actually tested. The current results aren't exactly the same as previous results since the incremental search doesn't necessarily see all the new messages that pertain to the thread. This means that some author names are missing. I plan to fix this by doing an additional database search for all messages in each thread. Of course, this will also be different than before since now the result will display *all* authors in the thread (rather than only those that matched the search) but that's probably what we really want to display anyway.
* libnotmuch: Underlying support for doing partial-results searches.Carl Worth2009-11-12
| | | | | | The library interface now allows the caller to do incremental searches, (such as one page of results at a time). Next we'll just need to hook this up to "notmuch search" and the emacs interface.
* notmuch search: Print the names of author of matched emails.Carl Worth2009-11-12
| | | | | | | It's important to have the names present for determining whether a thread is worth reading or not. We may want to think about abbreviating the list somehow if it is excessively long (or redundant as in bugzilla-daemon, bugzilla-daemon, bugzilla-daemon, etc.).
* Unbreak several notmuch commands after the addition of configuration.Carl Worth2009-11-11
| | | | | | | | | | | | | | | | | | | | | | All of the following commands: notmuch dump notmuch reply notmuch restore notmuch search notmuch show notmuch tag were calling notmuch_database_open with an argument of NULL. This was a legitimate call until the recent addition of configuration, after which it is expected that all commands will lookup the correct path in the configuration file. So fix all these commands to do that. Also, while touching all of these commands, we fix them to use the talloc context that is passed in rather than creating a local talloc context. We also switch from using goto for return values, to doing direct returns as soon as an error is detected, (which can be leak free thanks to talloc).
* notmuch: Break notmuch.c up into several smaller files.Carl Worth2009-11-10
Now that the client sources are alone here in their own directory, (with all the library sources down inside the lib directory), we can break the client up into multiple files without mixing the files up. The hope is that these smaller files will be easier to manage and maintain.