Hi, You should extend the SegmentReader (or IndexReader) class to implement the following method:
*public* *long* termID(Term t) *throws* IOException { *return* tis.getPosition(t); } which will give you a mean to get the ID of a given term. This ID is simply the position of that term within ".ti?" file ! Hope this will help Regards, Samir 2007/9/1, Tao Cheng <[EMAIL PROTECTED]>: > > Hi all, > > I found that instead of storing a term ID for a term in the index, Lucene > stores the actual term string value. I am wondering if there ever is such > a > "term ID" for each distinctive term indexed in Lucne, similar as a "doc > ID" > for each distinctive document indexed in Lucene. > > In other words, I am looking for a method like " int termId(string term)" > in > the IndexReader, such that it can return my an ID given a term's string > value. > > Thanks a lot in advance. > > -Tao >