Skip to content

Commit

Permalink
remove incompatible version
Browse files Browse the repository at this point in the history
Signed-off-by: Vijayan Balasubramanian <[email protected]>
  • Loading branch information
VijayanB committed Dec 3, 2024
1 parent 23c9268 commit b3cf208
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
strategy:
matrix:
java: [ 11, 17 ]
bwc_version : ["2.0.1", "2.1.0", "2.2.1", "2.3.0", "2.4.1", "2.5.0", "2.6.0", "2.7.0", "2.8.0", "2.9.0", "2.10.0", "2.11.0", "2.12.0", "2.13.0", "2.14.0", "2.15.0", "2.16.0" ]
bwc_version : [ "2.15.0", "2.16.0" ]
opensearch_version : [ "2.17.1-SNAPSHOT" ]

name: k-NN Restart-Upgrade BWC Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void testNonKNNIndex_withMethodParams_withNMSLIBEngine() throws Exception
createKnnIndex(
testIndex,
createKNNDefaultScriptScoreSettings(),
createKnnIndexMapping(TEST_FIELD, DIMENSIONS, "hnsw", KNNEngine.LUCENE.getName(), SpaceType.DEFAULT.getValue(), false)
createKnnIndexMapping(TEST_FIELD, DIMENSIONS, "hnsw", KNNEngine.NMSLIB.getName(), SpaceType.DEFAULT.getValue(), false)
);
addKNNDocs(testIndex, TEST_FIELD, DIMENSIONS, DOC_ID, NUM_DOCS);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ public static class Builder extends ParametrizedFieldMapper.Builder {
@Setter
@Getter
private OriginalMappingParameters originalParameters;
@Setter
private boolean isKnnIndex;

public Builder(
String name,
Expand All @@ -197,7 +195,6 @@ public Builder(
this.indexCreatedVersion = indexCreatedVersion;
this.knnMethodConfigContext = knnMethodConfigContext;
this.originalParameters = originalParameters;
this.isKnnIndex = true;
}

@Override
Expand Down Expand Up @@ -253,7 +250,7 @@ public KNNVectorFieldMapper build(BuilderContext context) {
);
}

if (originalParameters.getResolvedKnnMethodContext() == null || isKnnIndex == false) {
if (originalParameters.getResolvedKnnMethodContext() == null) {
return FlatVectorFieldMapper.createFieldMapper(
buildFullName(context),
name,
Expand Down Expand Up @@ -366,13 +363,10 @@ public Mapper.Builder<?> parse(String name, Map<String, Object> node, ParserCont
);
}
// Check for flat configuration
if (isKNNDisabled(parserContext.getSettings())) {
builder.setKnnIndex(false);
if (parserContext.indexVersionCreated().onOrAfter(Version.V_2_17_0)) {
// on and after 2_17_0 we validate to makes sure that mapping doesn't contain parameters that are
// specific to approximate knn search algorithms
validateFromFlat(builder);
}
if (isKNNDisabled(parserContext.getSettings()) && parserContext.indexVersionCreated().onOrAfter(Version.V_2_17_0)) {
// on and after 2_17_0 we validate to makes sure that mapping doesn't contain parameters that are
// specific to approximate knn search algorithms
validateFromFlat(builder);
} else if (builder.modelId.get() != null) {
validateFromModel(builder);
} else {
Expand Down

0 comments on commit b3cf208

Please sign in to comment.