The full error is: Exception in thread "main" java.lang.NullPointerException at Priorart.Lucene.Expert.index.MultiSegmentReader$MultiTermDocs.freq(Mu ltiSegmentReader.java:709) I looked at issue LUCENE-781<https://issues.apache.org/jira/browse/LUCENE-781>- it might relates to this one?? Though it is closed since 2007.
Hope anyone can help with it - even if I try double totalFreqT = ir.termDocs().freq(); - to get the freq using termDocs of a multi-segment, I get the same error.. Thanks alot, Liat 2009/6/28 liat oren <oren.l...@gmail.com> > Hi, > > I have an index that is a multi-segment index (how come it is created this > way?) > > When I try to get the freq of a term at the following way: > TermDocs tDocs = this.indexReader.termDocs(term); > tf = tDocs.freq(); > the greq method : > public int freq() > { > return current.freq(); > } > is in MultiSegmentReader. > > The current is null, so I get an exception. > > Should I initialize current? > How can I avoid this problem? > How can I avoid having a multi-segment index? > > Many thanks, > Liat >