> > For position increments, it doesn't have to be tracked. The patch to
> > DocumentWriter could also be:
> >
> >       int position = fieldPositions[fieldNumber];
> > +      if (position>0) position+=analyzer.getPositionIncrementGap
> > (fieldName)
>
> This could be thwarted with tokens using zero position offsets
> though, no?

I haven't seen it, but if someone were to set all position increments
to zero for a field, then yes it wouldn't work.  Checking length
(which counts tokens) would work though:

+ if (length>0) position+=analyzer.getPositionIncrementGap (fieldName)

It is either expand Field slightly, or expand Analyzer.

Sort of... one is adding a new data member, one is behavioral.

> The Analyzer extensions seem fine, but much more general purpose than my need.

For your need (a global increment), isn't expanding analyzer actually easier?
analyser = new OldAnalyzer() {
  public int getPositionIncrementGap(String field) {
    return 1000;
  }
}

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to