File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed
main/java/org/elasticsearch/index/codec/vectors
test/java/org/elasticsearch/index/codec/vectors Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change 1818import org .apache .lucene .codecs .perfield .PerFieldKnnVectorsFormat ;
1919import org .apache .lucene .index .SegmentReadState ;
2020import org .apache .lucene .index .SegmentWriteState ;
21- import org .elasticsearch .common .util .FeatureFlag ;
2221
2322import java .io .IOException ;
2423
4645 */
4746public class IVFVectorsFormat extends KnnVectorsFormat {
4847
49- static final FeatureFlag IVF_FORMAT_FEATURE_FLAG = new FeatureFlag ("ivf_format" );
5048 public static final String IVF_VECTOR_COMPONENT = "IVF" ;
5149 public static final String NAME = "IVFVectorsFormat" ;
5250 // centroid ordinals -> centroid values, offsets
@@ -69,18 +67,15 @@ public class IVFVectorsFormat extends KnnVectorsFormat {
6967
7068 public IVFVectorsFormat (int vectorPerCluster ) {
7169 super (NAME );
72- if (IVF_FORMAT_FEATURE_FLAG . isEnabled () == false ) {
73- throw new IllegalStateException ( "IVF format is not enabled " );
70+ if (vectorPerCluster <= 0 ) {
71+ throw new IllegalArgumentException ( "vectorPerCluster must be > 0 " );
7472 }
7573 this .vectorPerCluster = vectorPerCluster ;
7674 }
7775
7876 /** Constructs a format using the given graph construction parameters and scalar quantization. */
7977 public IVFVectorsFormat () {
8078 this (DEFAULT_VECTORS_PER_CLUSTER );
81- if (IVF_FORMAT_FEATURE_FLAG .isEnabled () == false ) {
82- throw new IllegalStateException ("IVF format is not enabled" );
83- }
8479 }
8580
8681 @ Override
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ public void testSearchWithVisitedLimit() {
6060
6161 @ Override
6262 protected Codec getCodec () {
63- assumeTrue ("IVF format flat enabled" , IVFVectorsFormat .IVF_FORMAT_FEATURE_FLAG .isEnabled ());
6463 return TestUtil .alwaysKnnVectorsFormat (format );
6564 }
6665}
You can’t perform that action at this time.
0 commit comments