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