lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: document ID and performance
Date Tue, 16 Nov 2004 14:45:53 GMT
Yan Pujante wrote:
> I want to run a very fast search that simply returns the matching 
> document id. Is there any way to associate the document id returned in 
> the hit collector to the internal document ID stored in the index ? 
> Anybody has any idea how to do that ? Ideally you would want to be able 
> to write something like this:
> 
>     document.add(Field.ID(documentID));
> 
> and then in the HitCollector API:
> 
> collect(String documentID, float score) with the documentID being the 
> one you stored (but which would be returned very efficiently)

Have a look at:
 
http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/FieldCache.html

In your HitCollector, access an array, from the field cache, that maps 
Lucene ids to your ids.

Doug


---------------------------------------------------------------------
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