Proposed New sort API

David Bremner david at tethera.net
Sun Oct 21 04:44:07 PDT 2018


William Casarin <jb55 at jb55.com> writes:

> David Bremner <david at tethera.net> writes:
>
>> William Casarin <jb55 at jb55.com> writes:
>>
>>> Another thought I had that I wanted to throw out there for
>>> consideration. It would be nice to be able to sort by "popular" threads,
>>> aka sort by the number of messages in each thread. Not sure if this is
>>> an easy thing to do at the query level?
>>
>> I don't see how to manage it as a xapian query. In the current database
>> schema xapian doesn't really know about threads, except that messages
>> know what thread they belong to.
>
> I noticed notmuch-search shows the number of messages in the thread,
> perhaps you could just sort on that value when returning the results?

AFAIU, currently there is no explicit sorting of threads returned, any
sorting is a side effect of the sorting of the underlying
messages. Since the threads are generated lazily, for queries generating
a large number of threads such a post thread generation sorting would
generate a noticeable delay. On the other hand, if it was optional, I
guess that would be OK. It would introduce some complications and new
code paths orthogonal to the other stuff we've been talking about.

d


More information about the notmuch mailing list