BTW Mark, I think the deprecation message in Hits should not even mention
TSDC, but instead show the "fast" search method search(Query, int) or
something like that. We're giving users a wrong impression as if they really
need to create TSDC and this can confuse people (see other thread by Eks).

Shai

On Wed, Sep 30, 2009 at 5:52 PM, Shai Erera <ser...@gmail.com> wrote:

> 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 <markrmil...@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-unsubscr...@lucene.apache.org
>> For additional commands, e-mail: java-dev-h...@lucene.apache.org
>>
>>
>

Reply via email to