You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Vijay J <vi...@thoughtworks.com> on 2012/01/31 15:48:15 UTC

Grouping and sorting results

Hi,

I'm running into some issues with solr scoring affecting ordering of query
results. Is it possible to run a Solr boolean query to check if
a document contains any search terms and get the results back without any
scoring mechanism besides presence or absence of any of the search
terms? Basically I'd like to turn off tf-idf/Vector space scoring for one
query and get the ordering by boolean instead of score.

As an example, suppose I have a collection of wholesale providers and some
of the wholesale providers are preferred over other providers. I'd like
Solr to get all the preferred providers,
apply an ordering  then get all the non-preferred providers and apply an
ordering.  (i.e. give me a group of preferred providers and apply a sort to
the preferred provider result set and group non-preferred provider and sort
that result set)
The preferred status of the provider is not known ahead of time until query
execution.


Can you give us a lead on this?

Thank you!


Regards,
Vijay

Re: Grouping and sorting results

Posted by Erick Erickson <er...@gmail.com>.
Nothing that I know of wil give you what you want OOB, but
there are two possibilities:

Query Elevantion Component is a broad-brush way to go,
but it's not very flexible so if 10 minutes looking at how it
works doesn't excite you, don't spend too much time on it.

If, at query time, you know your provider ordering, you can
take advantage of the tf/idf stuff by, say, adding a clause like
(provider1^10 provider2^8 provider3^6 ....) where your
default operator is OR.... Made up boost numbers BTW.

Best
Erick

On Tue, Jan 31, 2012 at 9:48 AM, Vijay J <vi...@thoughtworks.com> wrote:
> Hi,
>
> I'm running into some issues with solr scoring affecting ordering of query
> results. Is it possible to run a Solr boolean query to check if
> a document contains any search terms and get the results back without any
> scoring mechanism besides presence or absence of any of the search
> terms? Basically I'd like to turn off tf-idf/Vector space scoring for one
> query and get the ordering by boolean instead of score.
>
> As an example, suppose I have a collection of wholesale providers and some
> of the wholesale providers are preferred over other providers. I'd like
> Solr to get all the preferred providers,
> apply an ordering  then get all the non-preferred providers and apply an
> ordering.  (i.e. give me a group of preferred providers and apply a sort to
> the preferred provider result set and group non-preferred provider and sort
> that result set)
> The preferred status of the provider is not known ahead of time until query
> execution.
>
>
> Can you give us a lead on this?
>
> Thank you!
>
>
> Regards,
> Vijay