diff --git a/java/src/main/java/com/spotify/voyager/jni/StringIndex.java b/java/src/main/java/com/spotify/voyager/jni/StringIndex.java index 097184f5..701c4475 100644 --- a/java/src/main/java/com/spotify/voyager/jni/StringIndex.java +++ b/java/src/main/java/com/spotify/voyager/jni/StringIndex.java @@ -281,6 +281,14 @@ public void addItems(Map> vectors) { index.addItems(primitiveVectors, labels, -1); } + public long getNumElements() { + return index.getNumElements(); + } + + public float[] getVector(String name) { + return index.getVector(names.indexOf(name)); + } + private float[] toPrimitive(List vector) { float[] vectorValues = new float[vector.size()]; assignPrimitive(vector, vectorValues);