[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    Re: Upgrading from 9.1.0. to 9.4.0: Old codecs may only be used for reading Lucene91HnswVectorsForma
From:       Michael Wechner <michael.wechner () wyona ! com>
Date:       2022-10-01 10:57:04
Message-ID: ebf9788c-5ce3-e3e4-6f60-2e338efdc467 () wyona ! com
[Download RAW message or body]

ah ok :-)

I think I just set it, because I saw this in one of the code examples 
and assumed that it might be necessary.

Yes, I am using HNSW, but I don't think I set any particular HNSW 
parameters.

I will double-check and will try without setting the codec.

Thanks

Michael

Am 01.10.22 um 12:56 schrieb Adrien Grand:
> The best practice is to not set the codec explicitly, and Lucene will make
> sure to always use the right one.
> 
> Seeing the codec explicitly is considered expert. I guess you are doing
> this because you want to configure things like stored fields compression or
> HNSW parameters? If so, there is no better way than what you are doing.
> 
> 
> Le sam. 1 oct. 2022, 12:31, Michael Wechner <michael.wechner@wyona.com> a
> écrit :
> 
> > Hi Adrien
> > 
> > Thank you very much for your help!
> > 
> > That was it :-) I completely forgot that I set this somewhere hidden
> > inside my code.
> > I made a note in the pom file, such that I should not forget again
> > during the next upgrade :-)
> > 
> > Or what is the best practice re setting / handling the codec?
> > 
> > Thanks
> > 
> > Michael
> > 
> > Am 01.10.22 um 08:06 schrieb Adrien Grand:
> > > I would guess that you are configuring your IndexWriterConfig with a
> > > "Lucene91Codec" instance. You need to replace it with a "Lucene94Codec"
> > > instance.
> > > 
> > > Le sam. 1 oct. 2022, 06:12, Michael Wechner <michael.wechner@wyona.com>
> > a
> > > écrit :
> > > 
> > > > Hi
> > > > 
> > > > I have just upgraded from 9.1.0 to 9.4.0 and compiling works fine, but
> > > > when I run and re-index my data using KnnVectorField, then I receive the
> > > > following exception:
> > > > 
> > > > java.lang.UnsupportedOperationException: Old codecs may only be used for
> > > > reading
> > > > at
> > > > 
> > org.apache.lucene.backward_codecs.lucene91.Lucene91HnswVectorsFormat.fieldsWriter(Lucene91HnswVectorsFormat.java:131)
> > 
> > > > ~[lucene-backward-codecs-9.4.0.jar:9.4.0
> > > > d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 - sokolovm - 2022-09-30
> > 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat$FieldsWriter.getInstance(PerFieldKnnVectorsFormat.java:161)
> > 
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat$FieldsWriter.addField(PerFieldKnnVectorsFormat.java:105)
> > 
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.index.VectorValuesConsumer.addField(VectorValuesConsumer.java:70)
> > 
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.index.IndexingChain.initializeFieldInfo(IndexingChain.java:665)
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.index.IndexingChain.processDocument(IndexingChain.java:556)
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:241)
> > 
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:432)
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1533)
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > 
> > org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1818)
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > at
> > > > org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1471)
> > > > ~[lucene-core-9.4.0.jar:9.4.0 d2e22e18c6c92b6a6ba0bbc26d78b5e82832f956 -
> > > > sokolovm - 2022-09-30 14:55:13]
> > > > 
> > > > Any idea what I might be doing wrong?
> > > > 
> > > > Thanks
> > > > 
> > > > Michael
> > > > 
> > > > ---------------------------------------------------------------------
> > > > 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
> > 
> > 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic