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 Andy <an...@yahoo.com> on 2010/01/15 21:47:26 UTC

only use sorting when there's no "q" is "*:*"?

Is it possible to set up Solr such that when there's no query (client would send in "*:*" for "q"), Solr would sort results (basically all the documents) by date or some other criterion.

And when there is a query other than "*:*", I'd want the results to be ranked by score.

Is that something that's possible?


      

Re: only use sorting when there's no "q" is "*:*"?

Posted by Chris Hostetter <ho...@fucit.org>.
: It uses the doc insertion order by default.

Strictly speaking: it sorts by score, and when multiple docs have 
identical scores, the secondary sorting is undefined (as an implementation 
detail it is _usually_ doc insertion order, but that's not really 
garunteed.

As for your original question...

: > > > Is it possible to set up Solr such that when there's
: > > no query (client would send 
: > > > in "*:*" for "q"), Solr would sort results (basically
: > > all the documents) by date 
: > > > or some other criterion.

why not use:   sort = score desc, myDateField asc


-Hoss


Re: only use sorting when there's no "q" is "*:*"?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
It uses the doc insertion order by default.

Otis
--
Sematext -- http://sematext.com/ -- Solr - Lucene - Nutch



----- Original Message ----
> From: Andy <an...@yahoo.com>
> To: solr-user@lucene.apache.org
> Sent: Fri, January 15, 2010 4:52:44 PM
> Subject: Re: only use sorting when there's no "q" is "*:*"?
> 
> I see. Thank you.
> 
> Out of curiosity, when q is *:*, how does Solr decide on the ordering of the 
> results?
> 
> --- On Fri, 1/15/10, Otis Gospodnetic wrote:
> 
> > From: Otis Gospodnetic 
> > Subject: Re: only use sorting when there's no "q" is "*:*"?
> > To: solr-user@lucene.apache.org
> > Date: Friday, January 15, 2010, 4:42 PM
> > I don't think there is anything like
> > that built right into Solr, but it looks like something that
> > should be easy enough to add to your search app talking to
> > Solr.
> > 
> > Otis
> > --
> > Sematext -- http://sematext.com/ -- Solr - Lucene - Nutch
> > 
> > 
> > 
> > ----- Original Message ----
> > > From: Andy 
> > > To: solr-user@lucene.apache.org
> > > Sent: Fri, January 15, 2010 3:47:26 PM
> > > Subject: only use sorting when there's no "q" is
> > "*:*"?
> > > 
> > > Is it possible to set up Solr such that when there's
> > no query (client would send 
> > > in "*:*" for "q"), Solr would sort results (basically
> > all the documents) by date 
> > > or some other criterion.
> > > 
> > > And when there is a query other than "*:*", I'd want
> > the results to be ranked by 
> > > score.
> > > 
> > > Is that something that's possible?
> > 
> > 


Re: only use sorting when there's no "q" is "*:*"?

Posted by Andy <an...@yahoo.com>.
I see. Thank you.

Out of curiosity, when q is *:*, how does Solr decide on the ordering of the results?

--- On Fri, 1/15/10, Otis Gospodnetic <ot...@yahoo.com> wrote:

> From: Otis Gospodnetic <ot...@yahoo.com>
> Subject: Re: only use sorting when there's no "q" is "*:*"?
> To: solr-user@lucene.apache.org
> Date: Friday, January 15, 2010, 4:42 PM
> I don't think there is anything like
> that built right into Solr, but it looks like something that
> should be easy enough to add to your search app talking to
> Solr.
> 
> Otis
> --
> Sematext -- http://sematext.com/ -- Solr - Lucene - Nutch
> 
> 
> 
> ----- Original Message ----
> > From: Andy <an...@yahoo.com>
> > To: solr-user@lucene.apache.org
> > Sent: Fri, January 15, 2010 3:47:26 PM
> > Subject: only use sorting when there's no "q" is
> "*:*"?
> > 
> > Is it possible to set up Solr such that when there's
> no query (client would send 
> > in "*:*" for "q"), Solr would sort results (basically
> all the documents) by date 
> > or some other criterion.
> > 
> > And when there is a query other than "*:*", I'd want
> the results to be ranked by 
> > score.
> > 
> > Is that something that's possible?
> 
> 


      

Re: only use sorting when there's no "q" is "*:*"?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
I don't think there is anything like that built right into Solr, but it looks like something that should be easy enough to add to your search app talking to Solr.

Otis
--
Sematext -- http://sematext.com/ -- Solr - Lucene - Nutch



----- Original Message ----
> From: Andy <an...@yahoo.com>
> To: solr-user@lucene.apache.org
> Sent: Fri, January 15, 2010 3:47:26 PM
> Subject: only use sorting when there's no "q" is "*:*"?
> 
> Is it possible to set up Solr such that when there's no query (client would send 
> in "*:*" for "q"), Solr would sort results (basically all the documents) by date 
> or some other criterion.
> 
> And when there is a query other than "*:*", I'd want the results to be ranked by 
> score.
> 
> Is that something that's possible?