Java Mailing List Archive

http://www.java2.5341.com/

Home » java-user.lucene »

TermDocs and "read"

Carlos Rodríguez Fernández

2008-10-20

Replies: Find Java Web Hosting

Author LoginPost Reply
Hello:
I have a problem with TermDocs#read operation.

the following code has an incorrect result:

       .....
       int termFreq=0;
       .....
       TermDocs termDocs = indexReader.termDocs(new
Term(((Field)field).name(),termCons));
       int[] freqs = new int[]{0};
       termDocs.read(new int[]{doc}, freqs);
       termFreq+=freqs[0];
       ....

the freqs array always return with a "[1]" for all terms and for all
documents. :S

Can you help me please?

Thanks a lot!
Carlos
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.