Re: Sorting by Score

2007-03-01 Thread Erick Erickson
Peter: About a custom ScoreComparator. The problem I couldn't get past was that I needed to know the max score of all the docs in order to divide the raw scores into quintiles since I was dealing with raw scores. I didn't see how to make that work with ScoreComparator, but I confess that I

Re: Sorting by Score

2007-03-01 Thread Peter Keegan
Erick, I think you're right because you'd wouldn't know the max score before the comparisons. I'm just thinking about a rounding algorithm that involves comparing the raw scores to the theoretical maximum score, which I think could be computed from the Similarity class and knowing the max boost

Re: Sorting by Score

2007-02-28 Thread Peter Keegan
can't you pick any arbitrary marker field name (that's not a real field name) and use that? Yes, I could. I guess you're saying that the field name doesn't matter, except that it's used for caching the comparator, right? ... he wants the bucketing to happen as part of hte scoring so that the

Re: Sorting by Score

2007-02-28 Thread Erick Erickson
Empirically, when I insert the elements in the FieldSortedHitQueue they get sorted according to the Sort object. The original query that gives me a TopDocs applied no secondary sorting, only relevancy. Since I normalized all the scores into one of only 5 discrete values, and secondary sorting was

Re: Sorting by Score

2007-02-28 Thread Peter Keegan
Erich, Yes, this seems to be the simplest way to implement score 'bucketization', but wouldn't it be more efficient to do this with a custom ScoreComparator? That way, you'd do the bucketizing and sorting in one 'step' (compare()). Maybe the savings isn't measurable, though. A comparator might

Re: Sorting by Score

2007-02-28 Thread Erick Erickson
It may well be, but as I said this is efficient enough for my needs so I didn't pursue it. One of my pet peeves is spending time making things more efficient when there's no need, and my index isn't going to grow enough larger to worry about that now G... Erick On 2/28/07, Peter Keegan [EMAIL

Re: Sorting by Score

2007-02-27 Thread Peter Keegan
Suppose one wanted to use this custom rounding score comparator on all fields and all queries. How would you get it plugged in most efficiently, given that SortField requires a non-null field name? Peter On 2/1/06, Chris Hostetter [EMAIL PROTECTED] wrote: : I've not used the sorting code

Re: Sorting by Score

2007-02-27 Thread Chris Hostetter
: Suppose one wanted to use this custom rounding score comparator on all : fields and all queries. How would you get it plugged in most efficiently, : given that SortField requires a non-null field name? i'm not sure i understand the first part of question .. this custom SortComparatorSource

Re: Sorting by Score

2007-02-27 Thread Peter Keegan
I'm building up the Sort object for the search with 2 SortFields - first is for the custom rounded scoring, second is for date. This Sort object is used to construct a FieldSortedHitQueue which is used with a custom HitCollector. And yes, this comparator ignores the field name. hmmm, actually i

Re: Sorting by Score

2007-02-27 Thread Erick Erickson
This may be off base, but I've recently been in something similar. The first part was just to iterate through the TopDocs that's available to my and normalize the scores right in the ScoreDocs. Like this... for (ScoreDoc scd : this.topDocs.scoreDocs) { scd.score =

Re: Sorting by Score

2007-02-27 Thread Chris Hostetter
: The constructor doesn't complain, but FieldSortedHitQueue expects a field : name when it tries to locate the comparator from the cache: can't you pick any arbitrary marker field name (that's not a real field name) and use that? -Hoss

Re: Sorting by Score

2007-02-27 Thread Chris Hostetter
: The first part was just to iterate through the TopDocs that's available to : my and normalize the scores right in the ScoreDocs. Like this... Won't that be done after the Lucene does the hitcollecting/sorting? ... he wants the bucketing to happen as part of hte scoring so that the secondary

Fw: Sorting by Score

2006-02-06 Thread Daniel . Clark
Subject RE: Sorting by Score(Document link: Daniel clark

Sorting by Score

2006-02-01 Thread Daniel . Clark
My primary sort is by relevance score and my secondary sort is by date. The Hits.getScore() method returns the score by 7 digits to the right of the decimal point. Therefore, If I round to only 2 decimal points in the display, the underlying 7 point score will be different in the sort. Example:

RE: Sorting by Score

2006-02-01 Thread Eric Isakson
:24 AM To: java-user@lucene.apache.org Subject: Sorting by Score My primary sort is by relevance score and my secondary sort is by date. The Hits.getScore() method returns the score by 7 digits to the right of the decimal point. Therefore, If I round to only 2 decimal points in the display

RE: Sorting by Score

2006-02-01 Thread Chris Hostetter
: I've not used the sorting code yet, but it looks like you have to : provide some custom ScoreDocComparator by adding a SortField using the : SortField(String field, SortComparatorSource comparator) constructor. : I'm just not certain what you should specify for the field value since : you

RE: Sorting by Score

2006-02-01 Thread Eric Isakson
Hostetter Sent: Wednesday, February 01, 2006 4:06 PM To: java-user@lucene.apache.org Subject: RE: Sorting by Score : I've not used the sorting code yet, but it looks like you have to : provide some custom ScoreDocComparator by adding a SortField using the : SortField(String field

RE: Sorting by Score

2006-02-01 Thread Chris Hostetter
: from your previous post about memory...Every time you sort on a field, : a FieldCache array is constructed for that field. : : would that happen in this case for the field this comparator is not using? Ooohhh ... good question. As long as you write your own implimentation of