lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: GETVALUES +SEARCH
Date Wed, 01 Dec 2004 10:33:35 GMT
On Dec 1, 2004, at 12:41 AM, Karthik N S wrote:
>    Is there any API in Lucene Which can retrieve all the searched 
> Values in
> single fetch
>
>    into some sort of an 'Array'   WITHOUT using this [ below ] Looping
> process [ This would make
>
>    the Search and display more Faster ].
>
>      for (int i = 0; i < hits.length();i++) {
> 	      Document doc = hits.doc(i);
> 	      String path  = doc.get("path");
>             .....
>      }

Are you really showing *all* results at one time?  Or just the first 
several?  Iterating over all hits and retrieving each Document is often 
unwise and generally unnecessary if only the first 20 or so are shown 
at first.

I don't know of a simpler way to get all the "path" values in your 
example.  Perhaps a HitCollector is more to your liking?  Though it 
probably would not speed anything up for you.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message