lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: ArrayIndexOutOfBoundsException
Date Fri, 17 Aug 2007 18:41:55 GMT
Ignore the part about "much longer strings", I overlooked that this
was a single term....

But it still works on my machine, Lucene 2.1...

Erick

On 8/17/07, Michael McCandless <lucene@mikemccandless.com> wrote:
>
>
> Hmmm ... good catch.  With DocumentsWriter there is a max term length
> (currently 16384 chars).  I think we should fix it to raise a clearer
> exception?  I'll open an issue.
>
> Mike
>
> On Fri, 17 Aug 2007 19:53:09 +0200, "karl wettin" <karl.wettin@gmail.com>
> said:
> > When I add a field containing a really long term I get an AIOOBE. Is
> > this a documented feature?
> >
> >    public static void main(String[] args) throws Exception {
> >      RAMDirectory dir = new RAMDirectory();
> >      IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer
> > (Collections.emptySet()), true);
> >      StringBuffer buf = new StringBuffer(65535);
> >      for (int i=0; i<32767; i++) {
> >        buf.append("ha");
> >      }
> >      Document doc = new Document();
> >      doc.add(new Field("f", "three tokens here " + buf.toString(),
> > Field.Store.NO, Field.Index.TOKENIZED));
> >      iw.addDocument(doc);
> >      iw.close();
> >      dir.close();
> >    }
> >
> > Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
> >       at java.lang.System.arraycopy(Native Method)
> >       at org.apache.lucene.index.DocumentsWriter$ThreadState
> > $FieldData.addPosition(DocumentsWriter.java:1462)
> >       at org.apache.lucene.index.DocumentsWriter$ThreadState
> > $FieldData.invertField(DocumentsWriter.java:1285)
> >       at org.apache.lucene.index.DocumentsWriter$ThreadState
> > $FieldData.processField(DocumentsWriter.java:1215)
> >       at org.apache.lucene.index.DocumentsWriter
> > $ThreadState.processDocument(DocumentsWriter.java:936)
> >       at org.apache.lucene.index.DocumentsWriter.addDocument
> > (DocumentsWriter.java:2147)
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
>
> ---------------------------------------------------------------------
> 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