lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ChadDavis <chadmichaelda...@gmail.com>
Subject Re: ScoreDoc
Date Sun, 09 Nov 2008 22:36:01 GMT
In fact, the search method used to populate the collector used in that
sample code also claims to be low level.  It suggests using the
IndexSearcher.search( query ) method instead, but that method is deprecated.

Lower-level search API.
>
> HitCollector.collect(int,float) is called for every matching document.
>
> Applications should only use this if they need *all* of the matching
> documents. The high-level search API (Searcher.search(Query)) is usually
> more efficient, as it skips non-high-scoring hits.
>
> Note: The score passed to this method is a raw score. In other words, the
> score will not necessarily be a float whose value is between 0 and 1.
>
Is this just stale documentation ?

On Sun, Nov 9, 2008 at 3:28 PM, ChadDavis <chadmichaeldavis@gmail.com>wrote:

> The sample code uses a ScoreDoc array to hold the hits.
>
>     ScoreDoc[] hits = collector.topDocs().scoreDocs;
>
> But the JavaDoc says "Expert: Returned by low-level search
> implementations."  Why would the tutorial sample code use an "expert" api?
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message