lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Claude Dauphin <>
Subject How to read the index in terms order
Date Thu, 12 Nov 2009 14:45:56 GMT
Dear all,

I am pretty sure it's trivial and I apologize for raising this issue.

I wish to access the index in the order driven by:
   Term+"Field name"+Frequency or
   Frequency+Term+"Field Name".

I read the terms in the order driven by "Field name"+Term+°Frequency as

  Directory fsd =,
 IndexReader reader = new TermIndexReader(, true));

 TermEnum     terms  = reader.terms();
 while ( {
    Term term     = terms.term();
    int  termFreq = terms.docFreq();
    v.add(new DictionaryTerm(term, termFreq));

   It works fine, but how to change the reading order?
   Can I use a custom SortComparatorSource class?

   Any advice or code example would be appreciated



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message