File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
server/src/main/java/org/elasticsearch/index
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ private static Version parseUnchecked(String version) {
159159 public static final IndexVersion SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_UNSIGNED_LONG = def (9_019_0_00 , Version .LUCENE_10_1_0 );
160160 public static final IndexVersion SYNTHETIC_SOURCE_STORE_ARRAYS_NATIVELY_SCALED_FLOAT = def (9_020_0_00 , Version .LUCENE_10_1_0 );
161161 public static final IndexVersion USE_LUCENE101_POSTINGS_FORMAT = def (9_021_0_00 , Version .LUCENE_10_1_0 );
162+ public static final IndexVersion SEMANTIC_TEXT_DEFAULTS_TO_BBQ = def (9_022_0_00 , Version .LUCENE_10_1_0 );
162163 /*
163164 * STOP! READ THIS FIRST! No, really,
164165 * ____ _____ ___ ____ _ ____ _____ _ ____ _____ _ _ ___ ____ _____ ___ ____ ____ _____ _
Original file line number Diff line number Diff line change 9292import java .util .function .BiConsumer ;
9393import java .util .function .Function ;
9494
95+ import static org .elasticsearch .index .IndexVersions .SEMANTIC_TEXT_DEFAULTS_TO_BBQ ;
9596import static org .elasticsearch .inference .TaskType .SPARSE_EMBEDDING ;
9697import static org .elasticsearch .inference .TaskType .TEXT_EMBEDDING ;
9798import static org .elasticsearch .search .SearchService .DEFAULT_SIZE ;
@@ -1010,8 +1011,12 @@ private static Mapper.Builder createEmbeddingsField(
10101011 denseVectorMapperBuilder .dimensions (modelSettings .dimensions ());
10111012 denseVectorMapperBuilder .elementType (modelSettings .elementType ());
10121013
1013- DenseVectorFieldMapper .IndexOptions defaultIndexOptions = defaultSemanticDenseIndexOptions ();
1014- if (defaultIndexOptions .validate (modelSettings .elementType (), modelSettings .dimensions (), false )) {
1014+ DenseVectorFieldMapper .IndexOptions defaultIndexOptions = null ;
1015+ if (indexVersionCreated .onOrAfter (SEMANTIC_TEXT_DEFAULTS_TO_BBQ )) {
1016+ defaultIndexOptions = defaultSemanticDenseIndexOptions ();
1017+ }
1018+ if (defaultIndexOptions != null
1019+ && defaultIndexOptions .validate (modelSettings .elementType (), modelSettings .dimensions (), false )) {
10151020 denseVectorMapperBuilder .indexOptions (defaultIndexOptions );
10161021 }
10171022
You can’t perform that action at this time.
0 commit comments