|
|
-
Sort by the number of matching terms (coord value)
Nicholas Clark 2012-02-17, 02:47
Hi,
I'm looking for a way to sort results by the number of matching terms. Being able to sort by the coord() value or by the overlap value that gets passed into the coord() function would do the trick. Is there a way I can expose those values to the sort function?
I'd appreciate any help that points me in the right direction. I'm OK with making basic code modifications.
Thanks!
-Nick
+
Nicholas Clark 2012-02-17, 02:47
-
Re: Sort by the number of matching terms (coord value)
Li Li 2012-02-17, 02:58
you can fool the lucene scoring fuction. override each function such as idf queryNorm lengthNorm and let them simply return 1.0f. I don't lucene 4 will expose more details. but for 2.x/3.x, lucene can only score by vector space model and the formula can't be replaced by users.
On Fri, Feb 17, 2012 at 10:47 AM, Nicholas Clark <[EMAIL PROTECTED]> wrote:
> Hi, > > I'm looking for a way to sort results by the number of matching terms. > Being able to sort by the coord() value or by the overlap value that gets > passed into the coord() function would do the trick. Is there a way I can > expose those values to the sort function? > > I'd appreciate any help that points me in the right direction. I'm OK with > making basic code modifications. > > Thanks! > > -Nick >
+
Li Li 2012-02-17, 02:58
-
Re: Sort by the number of matching terms (coord value)
Nicholas Clark 2012-02-17, 03:45
I want to leave the score intact so I can sort by matching term frequency and then by score. I don't think I can do that if I modify all the similarity functions, but I think your solution would have worked otherwise.
It would be great if there was a way I could expose this information through a function query (similar to the new relevance functions in version 4.0). I'll have to see if I can figure out how those functions work.
-Nick On Thu, Feb 16, 2012 at 6:58 PM, Li Li <[EMAIL PROTECTED]> wrote:
> you can fool the lucene scoring fuction. override each function such as idf > queryNorm lengthNorm and let them simply return 1.0f. > I don't lucene 4 will expose more details. but for 2.x/3.x, lucene can only > score by vector space model and the formula can't be replaced by users. > > On Fri, Feb 17, 2012 at 10:47 AM, Nicholas Clark <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > > I'm looking for a way to sort results by the number of matching terms. > > Being able to sort by the coord() value or by the overlap value that gets > > passed into the coord() function would do the trick. Is there a way I can > > expose those values to the sort function? > > > > I'd appreciate any help that points me in the right direction. I'm OK > with > > making basic code modifications. > > > > Thanks! > > > > -Nick > > >
+
Nicholas Clark 2012-02-17, 03:45
|
|
All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by
Sematext