lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Claude Dauphin <jc.daup...@gmail.com>
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
follow:

  Directory fsd = FSDirectory.open(indexLoc_,
NoLockFactory.getNoLockFactory());
 IndexReader reader = new TermIndexReader(IndexReader.open(fsd, true));

 TermEnum     terms  = reader.terms();
 while (terms.next) {
    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

   Best,

  JC

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