lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wettin <karl.wet...@gmail.com>
Subject Re: Best way to count tokens
Date Wed, 31 Oct 2007 16:39:01 GMT

31 okt 2007 kl. 15.18 skrev Cool Coder:

> Hi Group,
>               I need to display list of tokens (tags) in my side  
> those have got maximum occurances in my index. One way I can think  
> of is to keep track of all tokens during analysis and accordingly  
> display them. Is there any other way? e.g. if I want to display  
> tokens in order of their occurences as well as their weightage.

Are you looking for the term frequency vector?

<http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/index/ 
IndexReader.html#getTermFreqVector(int,%20java.lang.String)>

If you are using 2.3 the TermVectorMapper might save you a couple of  
clock ticks sorting.


Or is this something you want to do prior to adding the document to  
the index?

-- 
karl

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


Mime
View raw message