[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130507013511.GA4769@udknight>
Date: Tue, 7 May 2013 09:35:11 +0800
From: Wang YanQing <udknight@...il.com>
To: Jean Delvare <jdelvare@...e.de>
Cc: "Yann E. MORIN" <yann.morin.1998@...e.fr>,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Michal Marek <mmarek@...e.cz>,
Roland Eggner <edvx1@...temanalysen.net>
Subject: Re: [PATCH] kconfig: sort found symbols by relevance
On Mon, May 06, 2013 at 05:28:32PM +0200, Jean Delvare wrote:
> Le Monday 06 May 2013 à 15:02 +0200, Yann E. MORIN a écrit :
> > From: "Yann E. MORIN" <yann.morin.1998@...e.fr>
> >
> > When searching for symbols, return the symbols sorted by relevance.
> >
> > Relevance is the ratio of the length of the matched string and the
> > length of the symbol name. Symbols of equal relevance are sorted
> > alphabetically.
> I did not look at the code, only tested it, and it does what I asked for
> originally: exact match is listed first. So thank you :)
>
> However I am not sure if your implementation is what we want. Your
> definition of "relevance" is somewhat arbitrary and may not be
> immediately to others. For example, my own definition of "relevance" was
> that symbols which start with the subject string are more relevant than
> the symbols which have the string in the middle. Others would possibly
> have other definitions.
But no matter what the definition of relevance in text search,
in the middle or start or end, the searcher always want the "results"
look like what they input literal.
I think Yann's definition make sense. It is just a pattern matching ratio question.
If you want in start, just use ^PCI(reguar search), then with the help of
this patch, will make people life easier.
This patch is not to replace the regular search, you can just use them together.
BTW, I haven't read the code right now, maybe I will read it tonight.
I test it, it works well, and I find it is useful to use it with regular search.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists