With a time stamp you can use a function query to boost the score of newer
documents:
http://wiki.apache.org/solr/SolrRelevancyFAQ#head-b1b1cdedcb9cd9bfd9c994709b4d7e540359b1fd

Bill

On Thu, Jul 9, 2009 at 5:58 PM, vivek sar <vivex...@gmail.com> wrote:

> How do we sort by internal doc id (say on one index only) using Solr?
> I saw couple of threads saying it (Sort.INDEXORDER) was not supported
> in Solr,
>
>
> http://www.nabble.com/sort-by-index-id-descending--td16124009.html#a16124009
>
> http://www.nabble.com/Reverse-sorting-by-index-order-td1321032.html#a1321032
>
> Has the index order support been added in Solr 1.4? How do we use that
> - any documentation?
>
> Thanks,
> -vivek
>
> On Thu, Jul 9, 2009 at 2:21 PM, Otis
> Gospodnetic<otis_gospodne...@yahoo.com> wrote:
> >
> > Ah, with multiple indices you can't rely on the max Lucene doc Id.  I
> think you have to do with the timestamp approach.
> >
> > Otis
> > --
> > Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
> >
> >
> >
> > ----- Original Message ----
> >> From: vivek sar <vivex...@gmail.com>
> >> To: solr-user@lucene.apache.org
> >> Sent: Thursday, July 9, 2009 1:13:54 PM
> >> Subject: Re: Boosting for most recent documents
> >>
> >> Thanks Otis. I got a distributed index - using Solr multi-core.
> >> Basically, I got 6 indexer instances running on 3 different boxes.
> >> Couple of questions,
> >>
> >> 1)  Is it possible to sort on document id for multiple-shards? How is
> that done?
> >> 2) How would boost by most recent doc at index time?
> >>
> >> Thanks,
> >> -vivek
> >>
> >>
> >>
> >> On Wed, Jul 8, 2009 at 7:47 PM, Otis
> >> Gospodneticwrote:
> >> >
> >> > Sort by the internal Lucene document ID and pick the highest one.
>  That might
> >> do the job for you.
> >> >
> >> > Otis
> >> > --
> >> > Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
> >> >
> >> >
> >> >
> >> > ----- Original Message ----
> >> >> From: vivek sar
> >> >> To: solr-user
> >> >> Sent: Wednesday, July 8, 2009 8:34:16 PM
> >> >> Subject: Boosting for most recent documents
> >> >>
> >> >> Hi,
> >> >>
> >> >>   I'm trying to find a way to get the most recent entry for the
> >> >> searched word. For ex., if I have a document with field name "user".
> >> >> If I search for user:vivek, I want to get the document that was
> >> >> indexed most recently. Two ways I could think of,
> >> >>
> >> >> 1) Sort by some time stamp field - but with millions of documents
> this
> >> >> becomes a huge memory problem as we have seen OOM with sorting before
> >> >> 2) Boost the most recent document - I'm not sure how to do this.
> >> >> Basically, we want to have the most recent document score higher than
> >> >> any other and then we can retrieve just 10 records and sort in the
> >> >> application by time stamp field to get the most recent document
> >> >> matching the keyword.
> >> >>
> >> >> Any suggestion on how can this be done?
> >> >>
> >> >> Thanks,
> >> >> -vivek
> >> >
> >> >
> >
> >
>

Reply via email to