I've added MUCH larger strings to a document without any problem,
but it was an FSDir. I admit that it is kind of "interesting" that this
happens just as you cross the magic number.
But I tried it on my machine and it works just fine, go figure <G>..
Erick
On 8/17/07, karl wettin <[EMAIL PROTECTED]> wrote:
>
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>