[ 
https://issues.apache.org/jira/browse/LUCENE-1290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598109#action_12598109
 ] 

Michael Busch commented on LUCENE-1290:
---------------------------------------

{quote}
FWIW, the Hits API was originally designed to support desktop applications, 
with a scrollable pane of hits. I wonder if anyone ever actually used it that 
way, and, if so, whether it worked well...
{quote}

That's how it was used in the SeartchFiles demo and it worked quite well for 
this small tool.

But I believe in real-world apps Hits has quite a few drawbacks. For example, 
it always 
fetches 50 results and buffers them. This number is not configurable which it 
should be
for performance reasons. Also, I think very often users need to implement their 
own
HitCollector anyways, e. g. for duplication detected or security, and can't use 
Hits then.

As the new demo shows, it is quite easy to implement paging without Hits, just 
by  using
TopDocs and TopDocCollector.

> 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
>
>
> 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]

Reply via email to