Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Fix FieldInfo Parameters Mismatch #1492

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Documentation
### Maintenance
* Bump faiss lib commit to 32f0e8cf92cd2275b60364517bb1cce67aa29a55 [#1443](https://github.com/opensearch-project/k-NN/pull/1443)
* Fix FieldInfo Parameters Mismatch [#1489](https://github.com/opensearch-project/k-NN/pull/1489)
### Refactoring
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static class FieldInfoBuilder {
private int vectorDimension;
private VectorSimilarityFunction vectorSimilarityFunction;
private boolean softDeletes;
private boolean isParentField;

public static FieldInfoBuilder builder(String fieldName) {
return new FieldInfoBuilder(fieldName);
Expand All @@ -92,6 +93,7 @@ private FieldInfoBuilder(String fieldName) {
this.vectorDimension = 0;
this.vectorSimilarityFunction = VectorSimilarityFunction.EUCLIDEAN;
this.softDeletes = false;
this.isParentField = false;
}

public FieldInfoBuilder fieldNumber(int fieldNumber) {
Expand Down Expand Up @@ -164,6 +166,11 @@ public FieldInfoBuilder softDeletes(boolean softDeletes) {
return this;
}

public FieldInfoBuilder isParentField(boolean isParentField) {
this.isParentField = isParentField;
return this;
}

public FieldInfo build() {
return new FieldInfo(
fieldName,
Expand All @@ -181,7 +188,8 @@ public FieldInfo build() {
vectorDimension,
VectorEncoding.FLOAT32,
vectorSimilarityFunction,
softDeletes
softDeletes,
isParentField
);
}
}
Expand Down
Loading