lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venkateshprasanna <prasanna...@yahoo.co.in>
Subject Re: Extracting data from Lucene index files
Date Tue, 26 Dec 2006 04:07:46 GMT

Thanks a lot Doron, it worked fine and thanks for your tip as well!

Prasanna



Using term vectors means passing on the terms too many times - i.e
- loop on terms
- - loop on docs of a term
- - - loop on terms of a doc

Would something like this be better:
    do {
      System.out.println(tenum.term()+" appears in "+tenum.docFreq()+"
docs!");
      TermDocs td = reader.termDocs(tenum.term());
      do {
        System.out.println("  In doc id: "+td.doc() + " it appears: " +
td.freq()+ " times");
      } while (td.next());
    } while (tenum.next());


Also, you can skip faster to a certain doc (id) or certain term using the
skipTo() methods.

Doron


-- 
View this message in context: http://www.nabble.com/Extracting-data-from-Lucene-index-files-tf2813318.html#a8050926
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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