Re: [Extra] SEARCHRES / IMAP4rev2 clarifications

Timo Sirainen <timo@sirainen.com> Tue, 30 March 2021 10:18 UTC

Return-Path: <timo@sirainen.com>
X-Original-To: extra@ietfa.amsl.com
Delivered-To: extra@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D76243A2DF1 for <extra@ietfa.amsl.com>; Tue, 30 Mar 2021 03:18:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nvig9QJQggaR for <extra@ietfa.amsl.com>; Tue, 30 Mar 2021 03:18:03 -0700 (PDT)
Received: from sirainen.com (mail.sirainen.com [94.237.26.55]) by ietfa.amsl.com (Postfix) with ESMTP id 7445B3A2DF5 for <extra@ietf.org>; Tue, 30 Mar 2021 03:17:49 -0700 (PDT)
Received: from [172.20.10.5] (unknown [109.240.91.118]) by sirainen.com (Postfix) with ESMTPSA id 6B5532B3C7F for <extra@ietf.org>; Tue, 30 Mar 2021 10:17:42 +0000 (UTC)
From: Timo Sirainen <timo@sirainen.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_F00480D5-909F-4D74-95B4-3DEBA6902114"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\))
Date: Tue, 30 Mar 2021 13:17:41 +0300
References: <741FE532-1213-49E9-901F-46EECB7A223C@sirainen.com> <6805c44c-83ce-49f7-2f24-e5b9a97479b4@isode.com> <ED927AB6-C129-440B-B3E0-CDB54412DF17@sirainen.com>
To: extra@ietf.org
In-Reply-To: <ED927AB6-C129-440B-B3E0-CDB54412DF17@sirainen.com>
Message-Id: <7903154F-9000-4E4A-A0A0-9D13AFEB5795@sirainen.com>
X-Mailer: Apple Mail (2.3654.60.0.2.21)
Archived-At: <https://mailarchive.ietf.org/arch/msg/extra/jksP7zIW7_JBfmeH51cwUPXUS7o>
Subject: Re: [Extra] SEARCHRES / IMAP4rev2 clarifications
X-BeenThere: extra@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email mailstore and eXtensions To Revise or Amend <extra.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/extra>, <mailto:extra-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/extra/>
List-Post: <mailto:extra@ietf.org>
List-Help: <mailto:extra-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/extra>, <mailto:extra-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Mar 2021 10:18:08 -0000

On 16. Mar 2020, at 13.52, Timo Sirainen <timo@sirainen.com> wrote:
> 
> On 13. Mar 2020, at 15.43, Alexey Melnikov <alexey.melnikov@isode.com <mailto:alexey.melnikov@isode.com>> wrote:
>> 
>>> 4) Interaction of FUZZY and SEARCHRES: SEARCH RETURN (SAVE MIN RELEVANCY)
>>> 
>>> Well, this is probably clear enough that RELEVANCY shouldn't affect $ results? But the FUZZY RFC doesn't specify very clearly how RELEVANCY should interact with MIN, MAX or COUNT options. Maybe it could use errata to clarify? I suppose with MIN/MAX only the one relevancy should be returned, and with COUNT all the relevancies?
>> 
>> We probably need to do an update at some point, but submitting errata is sensible in this case.
> 
> This is actually getting a bit confusing as well. The simple cases:
> 
> RETURN (ALL RELEVANCY) : return ALL relevancies
> RETURN (MIN RELEVANCY) : return only the MIN's relevancy
> RETURN (MAX RELEVANCY) : return only the MAX's relevancy
> RETURN (PARTIAL n:m RELEVANCY) : return only the PARTIAL result's relevancies
> 
> The more confusing ones:
> 
> RETURN (MIN MAX RELEVANCY) : return MIN and MAX relevancies. But what if MIN=MAX, i.e. only one result? Is there 1 or 2 relevancies returned?
> RETURN (MIN MAX PARTIAL n:m RELEVANCY) : Similar to above - what if MIN/MAX overlaps the PARTIAL results?
> RETURN (RELEVANCY) : Maybe this should be an error?
> RETURN (COUNT RELEVANCY) : Does this even make sense either?
> RETURN (MIN MAX PARTIAL n:m COUNT RELEVANCY) : Should COUNT change anything?
> 
> Maybe MIN and MAX should always prepend and append the min/max relevancies, regardless of whether they overlap each others or PARTIAL. And in COUNT case I'd make it a no-op regarding RELEVANCY.

This got a bit stuck a year ago. Thinking about this again, maybe RELEVANCY doesn't make sense when using MIN, MAX or COUNT? So add an errata to section 4:

The RELEVANCY return option MUST NOT be used unless ALL or PARTIAL return option is also used.

Also I remember thinking that the relevancy scores would be specific to the search query, so that it might not make sense to try to compare relevancy scores between two different search results. That's not explicitly said in the RFC though.