From ac8ca0be37e178b07eabc47a97b5ae9496f38c45 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Thu, 8 Feb 2024 17:38:00 -0600 Subject: [PATCH] add key in pojo for vector result --- .../opensearch/dispensers/KnnSearchOpDispenser.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/adapter-aws-opensearch/src/main/java/io/nosqlbench/adapter/opensearch/dispensers/KnnSearchOpDispenser.java b/adapter-aws-opensearch/src/main/java/io/nosqlbench/adapter/opensearch/dispensers/KnnSearchOpDispenser.java index 08d6ef014..a5e79a125 100644 --- a/adapter-aws-opensearch/src/main/java/io/nosqlbench/adapter/opensearch/dispensers/KnnSearchOpDispenser.java +++ b/adapter-aws-opensearch/src/main/java/io/nosqlbench/adapter/opensearch/dispensers/KnnSearchOpDispenser.java @@ -65,9 +65,12 @@ public class KnnSearchOpDispenser extends BaseOpenSearchOpDispenser { public static class Doc { private float[] values; + private String key; + public Doc() {} - public Doc(float[] values) { + public Doc(float[] values, String key) { this.values = values; + this.key = key; } public float[] getValues() { return values; @@ -79,6 +82,14 @@ public class KnnSearchOpDispenser extends BaseOpenSearchOpDispenser { public String toString() { return "{" + "values=" + values + "}"; } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } } }