Were the two fields that you added to the doc the same field name? In which case, the pos incr gap is in fact needed, even if the fields are pre-analyzed (have TokenStream values)?
Mike On Thu, Jul 2, 2009 at 10:25 AM, Shai Erera<ser...@gmail.com> wrote: > I hit NPE in DocInvertedPerField in the following scenario: > 1) Create IndexWriter w/ a null Analyzer. > 2) Add two fields to a Document, w/ a TokenStream (or one as not analyzed > and one as TokenStream, or two not analyzed). > 3) Add the document to the IndexWriter. > The NPE comes from processFields (line 79), when it tries to read the > position increment gap. > > I think I'm using it right, but want to verify. If I always add fields as > TokenStream, or untokenized, I don't really need the Analyzer on > IndexWriter. Also, in case of a TokenStream field, DocInverterPerField just > uses the TokenStream and not the Analyzer. So maybe it should read the > posIncrGap only if analyzer is not null? > > Is this a bug or a misuse of IndexWriter by me? > > Shai > --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org