lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lalevée (JIRA) <>
Subject [jira] Created: (LUCENE-766) Two same new field with and without Term vector make an IllegalStateException
Date Mon, 08 Jan 2007 10:27:27 GMT
Two same new field with and without Term vector make an IllegalStateException

                 Key: LUCENE-766
             Project: Lucene - Java
          Issue Type: Bug
          Components: Index
    Affects Versions: 2.1
            Reporter: Nicolas Lalevée

On a empty index, adding a document with two fields with the same name but with different
term vector option fail. The field with TermVector.WITH_POSITIONS_OFFSETS is correctly indexed,
as the offset are correclty extracted. The field with TermVector.NO is not. The TermVectorsWriter
tries to add offset info given to the data of the filedinfo from the "fnm" file, but the DocumentWriter
didn't prepared offset datas as it gets its info from the field itself, not from the fieldinfo.

Here is the stack trace :
java.lang.IllegalStateException: Trying to write offsets that are null!
	at org.apache.lucene.index.TermVectorsWriter.writeField(
	at org.apache.lucene.index.TermVectorsWriter.closeField(
	at org.apache.lucene.index.TermVectorsWriter.closeDocument(
	at org.apache.lucene.index.TermVectorsWriter.close(
	at org.apache.lucene.index.DocumentWriter.writePostings(
	at org.apache.lucene.index.DocumentWriter.addDocument(
	at org.apache.lucene.index.IndexWriter.addDocument(
	at org.apache.lucene.index.IndexWriter.addDocument(
	at org.apache.lucene.index.TestDocumentWriter.testTermVector(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at junit.framework.TestCase.runTest(
	at junit.framework.TestCase.runBare(
	at junit.framework.TestResult$1.protect(
	at junit.framework.TestResult.runProtected(
	at junit.framework.TestSuite.runTest(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

Attaching a patch with a test.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message