Hi,
Check the Hits javadoc:
* @deprecated Hits will be removed in Lucene 3.0. <p>
* Instead e. g. [EMAIL PROTECTED] TopDocCollector} and [EMAIL PROTECTED]
TopDocs} can be used:<br>
* <pre>
* TopDocCollector collector = new TopDocCollector(hitsPerPage);
* searcher.search(query, collector);
* ScoreDoc[] hits = collector.topDocs().scoreDocs;
* for (int i = 0; i < hits.length; i++) {
* int docId = hits[i].doc;
* Document d = searcher.doc(docId);
* // do something with current hit
* ...
* </pre>
Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
----- Original Message ----
> From: Cam Bazz <[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Monday, September 15, 2008 1:54:07 PM
> Subject: IndexSearcher.search
>
> Hello,
>
> What is the new favorable way of searching a query?
>
> I understand Hits will be depreciated. So how do we do it the new way?
> With hit collector?
>
> Best.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]