From be8a1ba53b14821452fd915f8136268ecfa63853 Mon Sep 17 00:00:00 2001 From: Naveen Tatikonda Date: Tue, 20 Feb 2024 19:53:42 -0600 Subject: [PATCH] Fix FieldInfo Parameters Mismatch Signed-off-by: Naveen Tatikonda --- CHANGELOG.md | 1 + .../opensearch/knn/index/codec/KNNCodecTestUtil.java | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b55634b53..93ad21dc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestUtil.java b/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestUtil.java index 39d9806e7..9926b4ed9 100644 --- a/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestUtil.java +++ b/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestUtil.java @@ -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); @@ -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) { @@ -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, @@ -181,7 +188,8 @@ public FieldInfo build() { vectorDimension, VectorEncoding.FLOAT32, vectorSimilarityFunction, - softDeletes + softDeletes, + isParentField ); } }