lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liat oren <oren.l...@gmail.com>
Subject Re: MultiSegmentReader problems - current is null
Date Tue, 30 Jun 2009 20:27:08 GMT
Ok, thanks a lot - I iwll try that tomorrow

Best,
Liat

2009/6/30 Simon Willnauer <simon.willnauer@googlemail.com>

> Hi,
> On Sun, Jun 28, 2009 at 2:39 PM, liat oren<oren.liat@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-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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