lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brisbart Franck <Franck.Brisb...@kelkoo.net>
Subject how to get an extra count
Date Tue, 04 Feb 2003 08:12:33 GMT
Hi all,

I'm trying to gather information about my non-searched (ie not used for 
the search) fields.
Let's take an index with 2 fields: 'artist' (for the artist name) an 
'type' (for his type of music).
I need to perform a search on the 'artist' field to retrieve a list of 
artists matching the query. But I also need to have the number of 
artists per 'type'.
My first solution was to write a HitCollector which do the work:
     public void collect(int doc, float score) {
     Document document = indexReader_.document(doc);
     if(document.get("type").equals("Rock"))
         nbRock++;
     ...
     }
But, as I first get the document to analyze my non-searched field, the 
treatment can be very long for searches with lots of results.

Is there any better(=faster) method to have this extra info ??

Thanks a lot for your help.
Franck


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