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 <[EMAIL PROTECTED]>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? > > >