lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Re: Hits deprecated note is wrong
Date Wed, 30 Sep 2009 15:52:00 GMT
I agree. The code sample was written before TSDC's create() method was
written. I should have searched for TSDC references by text ...
About docsScoredInOrder, I agree we should have elaborated on it in the
javadocs. I think a sample code exists somewhere in CHANGES, but it wouldn't
hurt to keep some sample code here too.

Can such fixes go into 3.0? (I don't see why not). Should I open an issue,
or do you want to quickly fix it?

Shai

On Mon, Sep 28, 2009 at 9:29 PM, Mark Miller <markrmiller@gmail.com> wrote:

> Mark Miller wrote:
> > Bummer - through a user, just found out we missed correcting the docs
> > for moving from Hits. He was quite perturbed ;)
> >
> >  * @deprecated
> >  * see {@link TopScoreDocCollector} and {@link TopDocs} :<br>
> >  * <pre>
> >  *   TopScoreDocCollector collector = new
> TopScoreDocCollector(hitsPerPage);
> >  *   searcher.search(query, collector);
> >  *   ScoreDoc[] hits = collector.topDocs().scoreDocs;
> >  *   for (int i = 0; i < hits.length; i++) {
> >  *     int docId = hits[i].doc;
> >  *     Document d = searcher.doc(docId);
> >  *     // do something with current hit
> >  *     ...
> >  * </pre>
> >
> > Nothing we can really do, but if for some reason we end up with a 2.9.1
> > rather than 3.0 next, we should fix. Hard enough to upgrade for some
> > without these mistakes :)
> >
> >
> This is actually quite nasty - I can see why he was perturbed. We point
> to a class without a public constructor like it shows. Then if you
> manage to find the static constructor, there is no doc for the params.
> Then if you read the top, you see that you should know if you want to
> collect in order - which users likely don't. We obviously don't even
> want to point them to this class - but we do.
>
> --
> - Mark
>
> http://www.lucidimagination.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

Mime
View raw message