adamjq commented on code in PR #4492: URL: https://github.com/apache/solr/pull/4492#discussion_r3364511001
########## solr/core/src/java/org/apache/solr/core/SolrFlatVectorFormat.java: ########## @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.solr.core; + +import java.io.IOException; +import org.apache.lucene.codecs.KnnVectorsFormat; +import org.apache.lucene.codecs.KnnVectorsReader; +import org.apache.lucene.codecs.KnnVectorsWriter; +import org.apache.lucene.codecs.hnsw.FlatVectorScorerUtil; +import org.apache.lucene.codecs.lucene99.Lucene99FlatVectorsFormat; +import org.apache.lucene.index.SegmentReadState; +import org.apache.lucene.index.SegmentWriteState; + +/** + * SPI-registered wrapper for {@link Lucene99FlatVectorsFormat}, which Lucene does not register as a + * {@link KnnVectorsFormat} in SPI. + * + * @lucene.spi {@value #NAME} + * @since 10.1 + */ +public final class SolrFlatVectorFormat extends KnnVectorsFormat { Review Comment: I agree that having a version from the start is a good idea given the potential for this to evolve in the future. The question would be should be it the Solr version (e.g. `Solr101FlatVectorFormat` for Solr 10.1), or the Lucene Version (e.g. `SolrLucene99FlatVectorsFormat`). The class is currently a very thin wrapper that delegates to the Lucene version. However, I could see the need to extend functionality to support the KNN query parser search logic. It's looks like Elastic had [a similar discussion in this thread](https://github.com/elastic/elasticsearch/pull/104872#discussion_r1474602654), so there's precedent there. I've updated the PR to use `Solr101FlatVectorFormat` but am open to changing it -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
