lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1290) Deprecate Hits
Date Tue, 27 May 2008 16:10:04 GMT

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

Hoss Man commented on LUCENE-1290:
----------------------------------

i've been away from the party while all the exciting stuff was being discussed, but for my
2 cents...

* I firmly believe deprecating Hits is the way to go
* I recognize the value in having a simple API that implements the Iterator API like HitIterator,
but that doesn't mean it needs to be powered by "Hits",  An alternate approach would be to
add an "iterator()" method to TopDocs and TopFieldDocs that returned an iterator over the
ScoreDocs ... or even an "iterator(Searcher)" method that would return a Iterator of "Hit"
objects -- this could have the exact same API as the HitIterator and Hit classes currently
do -- just more efficiently and with different constructors.

As Michael said: Hits is deprecated, not deleted.  clients will have plenty of time to change,
and the javadocs for Hits provides a good explanation for how to use TopDocs instead -- but
if people want to implement an "Iterator" based alternative, we should probably do that in
a new issue.


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


Mime
View raw message