Ok, thanks a lot - I iwll try that tomorrow Best, Liat
2009/6/30 Simon Willnauer <simon.willna...@googlemail.com> > Hi, > On Sun, Jun 28, 2009 at 2:39 PM, liat oren<oren.l...@gmail.com> wrote: > > 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. > same answer as in the last email you must call TermDocs#next() this > will set TermDocs#current > > TermDocs tDocs = this.indexReader.termDocs(term); > tDocs.next() > tf = tDocs.freq(); > > simon > > > > Should I initialize current? > > How can I avoid this problem? > > How can I avoid having a multi-segment index? > > > > Many thanks, > > Liat > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >