sorting question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

sorting question

shai deljo
Is there a way (in 1 query) to retrieve the best scoring X results and
then sort them by another field (date  for example)?
Reply | Threaded
Open this post in threaded view
|

Re: sorting question

Chris Hostetter-3

: Is there a way (in 1 query) to retrieve the best scoring X results and
: then sort them by another field (date  for example)?

not at the moment.

keep in mind, this is the type of thing that can be done easily on the
client side -- pull back the top X results sorted by score, then sort by
date.



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: sorting question

Walter Underwood, Netflix
You could also promote recent results with a function query term.
I've done that for news sites, where "recency" is an important
part of relevancy.  --wunder

On 3/23/07 4:59 PM, "Chris Hostetter" <[hidden email]> wrote:

>
> : Is there a way (in 1 query) to retrieve the best scoring X results and
> : then sort them by another field (date  for example)?
>
> not at the moment.
>
> keep in mind, this is the type of thing that can be done easily on the
> client side -- pull back the top X results sorted by score, then sort by
> date.
>
> -Hoss


Reply | Threaded
Open this post in threaded view
|

Re: sorting question

shai deljo
In reply to this post by Chris Hostetter-3
True, but let me ask the question in a different way.
The problem is that when I run the query and order by date then the
most recent results are not relevant enough (in general I find I need
to do work on top of what solr provides in order to get good
relevancy) so I guess I'm looking more for of a threashold to retrieve
results only from a certain score and I need this threshold to be
adaptive. I.e it's not about the number of results to retrieve since I
want as many as possible so I have better chance to get the most
recent one, but more about getting all the results that are relevant
enough.
When I display results sorted by score this is not a problem because
all these results hide in page number X (X is big).

I can think of several hacks (e.g calculating the distribution of
results myself) to do this but was wondering if there is a proper
solution.
Thx

On 3/23/07, Chris Hostetter <[hidden email]> wrote:

>
> : Is there a way (in 1 query) to retrieve the best scoring X results and
> : then sort them by another field (date  for example)?
>
> not at the moment.
>
> keep in mind, this is the type of thing that can be done easily on the
> client side -- pull back the top X results sorted by score, then sort by
> date.
>
>
>
> -Hoss
>
>
Reply | Threaded
Open this post in threaded view
|

Re: sorting question

Chris Hostetter-3
: True, but let me ask the question in a different way.
: The problem is that when I run the query and order by date then the
: most recent results are not relevant enough (in general I find I need

i wasn't suggesting you have Solr sort by date, i was suggesting you do
exactly what you asked about: have solr sort by score, then take the top N
docs and resort them by date -- my point was that he second step resorting
N by date) can easily be done on the client side since you're going to be
fetching down N results anyway.

: relevancy) so I guess I'm looking more for of a threashold to retrieve
: results only from a certain score and I need this threshold to be
: adaptive. I.e it's not about the number of results to retrieve since I

unfortunately this isn't pragmatic with Lucene scores, you can't have a
fixed "threshold" because scores from differnet searches arent'
comparable...

http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-912c1f237bb00259185353182948e5935f0c2f03



-Hoss