[racket-dev] Potential search improvement

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue May 29 13:18:18 EDT 2012

On Tue, May 29, 2012 at 11:53 AM, Eli Barzilay <eli at barzilay.org> wrote:
> Three hours ago, Sam Tobin-Hochstadt wrote:
>> On Tue, May 29, 2012 at 7:33 AM, Eli Barzilay <eli at barzilay.org> wrote:
>> > Just now, Sam Tobin-Hochstadt wrote:
>> >> I think you probably want to rank/divide '1' here based on how
>> >> much of the identifier is matched by the search.  For example, if
>> >> you search for 'current-sep-line', you probably want
>> >> 'current-line-sep' first, but currently you get
>> >> 'current-alist-line-sep' first.
>> [...]
>>
>> Getting away from the discussion on sorting speed, I don't think my
>> suggestion even requires sorting: just add a 1.5 for
>> match-all-subword-parts-to-whole-id.
>
> That won't work, since "current-line-sep" will have the all-subword
> match for both entries.  The first one is whatever comes first in the
> alphabetically sorted index.  You can see the same problem with a
> search for "current sep line".

No, what I mean is that you should separate based on whether the
subwords in the search string cover the entire identifier.  So
"current sep line" would rank "current-line-sep" ahead of
"current-alist-line-sep" because "alist" isn't matched.
-- 
sam th
samth at ccs.neu.edu


Posted on the dev mailing list.