[ https://issues.apache.org/jira/browse/LUCENE-1290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598632#action_12598632 ]
Mark Harwood commented on LUCENE-1290: -------------------------------------- Hits does seem to be very good at leading new Lucene users into writing non-performant code and on that basis is probably worth deprecating. However, in it's place I think we can do more to support the commonest search scenario users will have, which I suspect is the typical web-based search application, serving a page of "results xx to yy of z,zzz,zzz".. The HitPageCollector in the link below is more helpful in this respect than the raw TopDocCollector - it takes a "start" value in the constructor which represents the "xx" in the above. It could be extended to have read-only properties representing y and z too and helper methods e.g. isFirstPage, isLastPage. I'm sure many of us have coded this same logic in many different places over the years and I think it could usefully be in core as a better embodiment of best practice than Hits. See http://www.mail-archive.com/[EMAIL PROTECTED]/msg15344.html > Deprecate Hits > -------------- > > Key: LUCENE-1290 > URL: https://issues.apache.org/jira/browse/LUCENE-1290 > Project: Lucene - Java > Issue Type: Task > Components: Search > Reporter: Michael Busch > Assignee: Michael Busch > Priority: Minor > Fix For: 2.4 > > Attachments: lucene-1290.patch, lucene-1290.patch > > > The Hits class has several drawbacks as pointed out in LUCENE-954. > The other search APIs that use TopDocCollector and TopDocs should be used > instead. > This patch: > - deprecates org/apache/lucene/search/Hits, Hit, and HitIterator, as well as > the Searcher.search( * ) methods which return a Hits Object. > - removes all references to Hits from the core and uses TopDocs and ScoreDoc > instead > - Changes the demo SearchFiles: adds the two modes 'paging search' and > 'streaming search', > each of which demonstrating a different way of using the search APIs. The > former > uses TopDocs and a TopDocCollector, the latter a custom HitCollector > implementation. > - Updates the online tutorial that descibes the demo. > All tests pass. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]