The I think what you're looking for is getting the ScoreDoc[] stored in the
TopDocs object. Then modify each doc's score (a ScoreDoc has a doc ID and
score [float]) and then sort the array. You can use Arrays.sort(ScoreDoc[],
Comparator) by passing a Comparator which will compare the docs by their
score, and then possible by ID (when scores are equal).

Does that sound like what you're looking for?

On Wed, Jul 22, 2009 at 5:08 PM, henok sahilu <henok_sah...@yahoo.com>wrote:

> hey after the query returned top N docs
> then rearrange them with my algortim
>
>
>
> --- On Wed, 7/22/09, Shai Erera <ser...@gmail.com> wrote:
>
> From: Shai Erera <ser...@gmail.com>
> Subject: Re: reranking Lucene TopDocs
> To: java-user@lucene.apache.org
> Date: Wednesday, July 22, 2009, 6:57 AM
>
> You mean after the query has returned the top N docs? why?
>
> If it's before, then given your use case, there are a number of approaches
> you can use during indexing and/or search time, so that your custom ranking
> function would be applied to documents.
>
> Shai
>
> On Wed, Jul 22, 2009 at 4:53 PM, henok sahilu <henok_sah...@yahoo.com
> >wrote:
>
> > i like to write a code that re assign weight to documets so that they can
> > be reranked
> >
> > --- On Wed, 7/22/09, Shai Erera <ser...@gmail.com> wrote:
> >
> > From: Shai Erera <ser...@gmail.com>
> > Subject: Re: reranking Lucene TopDocs
> > To: java-user@lucene.apache.org
> > Date: Wednesday, July 22, 2009, 6:44 AM
> >
> > Can you be more specific? What do you mean by re-rank? Reverse the sort?
> > give different weights?
> >
> > Shai
> >
> > On Wed, Jul 22, 2009 at 4:35 PM, henok sahilu <henok_sah...@yahoo.com
> > >wrote:
> >
> > > hello there
> > > i like to re-rank lucene TopDoc result set.
> > > where shall i start
> > > thanks
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
>
>
>
>
>

Reply via email to