Subject: [MORG] Range limited searches

From: Daniel Keen <[email-masked]>
Date: Thu, 25 Mar 2010 17:49:23 -0700

Just to follow up on the meeting today... So, yes, with CONTEXT this works…

1 SORT RETURN (PARTIAL 1:50) (REVERSE DATE) UTF-8 UNDELETED

Unfortunately, this does kill the one really nice feature of ESEARCH
that gives us collapsed sequences - because we're going in reverse
order to get the "50 most recent", we end up getting something like:

* ESEARCH (TAG "1") PARTIAL (1:50
3881,4102,4101,4100,4099,4098,4097,4096,4095,4094,4093,4092,4091,4085,4082,4090,4089,4088,4087,4086,4084,4083,4081,4080,4079,4078,4077,4076,4075,4074,4073,4072,4071,4070,4069,4068,4067,4066,4065,4064,4063,4062,4061,4060,4059,4058,4057,4056,4055,4054)

:(

But without having a "if I say reverse then all sequences are in
reverse" way of doing this (which I think is a _bad_ idea), I suppose
that's just what I'm stuck with.

BTW, Timo: Dovecot 1.2.11 advertises CONTEXT=SEARCH but not
CONTEXT=SORT, despite the fact that it seems to implement it on the
sort command (as witnessed above, against the Dovecot server).  Are
there known issues with the impl and that's why you're not advertising
it?
--
Dan Keen
www.dankeen.com

---

From: Timo Sirainen <[email-masked]>
Date: Fri, 26 Mar 2010 10:26:09 +0200

> there known issues with the impl and that's why you're not advertising

It doesn't support sending ADDTO/REMOVEFROM events for SORT (UPDATE) when mailbox changes. That seemed like a lot of extra work. Maybe some day.

---

From: Dave Cridland <[email-masked]>
Date: Fri, 26 Mar 2010 10:33:37 +0000

> order to get the "50 most recent", we end up getting something like:

Ah, I see, because you want the "50 most recent".

You could do it in two smaller round-trips, of course, but that's  
ugly, and round-trips are evil.

My feel is that you either want to be able to say:

t SORT RETURN (PARTIAL -50:*) (DATE) UTF-8 UNDELETED

Which is again evil because it's inventing new syntax, so possibly:

t SORT RETURN (RPARTIAL 1:50) (DATE) UTF-8 UNDELETED

Both the above would mean "The last 50 results". This gives you the  
collapsed sequence behaviour you want, of course.

Or, perhaps, what you'd like to exist is:

t SORT RETURN (REVERSE PARTIAL 1:50) (REVERSE DATE) UTF-8 UNDELETED

ie, an explicit directive to reverse the results in delivery. This  
seems rather ugly to me, though.

Sorry, I probably should have thought of this when building it, but  
my own client doesn't actually use SORT, only SEARCH, so I never put  
quite as much thought in as I should have, and I was rather focussed  
on the use of PARTIAL against UPDATE contexts instead.

Out of all of these, I prefer RPARTIAL, BTW.

Dave.
-- 
Dave Cridland - mailto:[email-masked] - xmpp:[email-masked]
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade

---

From: Dave Cridland <[email-masked]>
Date: Fri, 26 Mar 2010 10:34:40 +0000

On Fri Mar 26 08:26:09 2010, Timo Sirainen wrote:
> It doesn't support sending ADDTO/REMOVEFROM events for SORT  
> (UPDATE) when mailbox changes. That seemed like a lot of extra  
> work. Maybe some day.

Yes, it mandates at least one updating context, which is awkward.

If there's demand for PARTIAL on its own, I'd be okay with dropping  
that requirement.

Dave.

---

From: Daniel Keen <[email-masked]>
Date: Fri, 26 Mar 2010 08:24:57 -0700

On Fri, Mar 26, 2010 at 3:34 AM, Dave Cridland <[email-masked]> wrote:
>> It doesn't support sending ADDTO/REMOVEFROM events for SORT (UPDATE) when
>> mailbox changes. That seemed like a lot of extra work. Maybe some day.
>
> If there's demand for PARTIAL on its own, I'd be okay with dropping that
> requirement.

I've wanted PARTIAL for a long, long time (uh, proviso, that means 4
years or so).  I actually didn't know that CONTEXT was going to give
me that, because I have little desire at the current time for CONTEXT,
and the partial results (which can be used outside of normal context
searches) are really just a byline in the midst of that spec.

D