mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-23 15:40:44 -06:00
adding Doc type for results
This commit is contained in:
parent
b7b790766e
commit
b16b04f466
@ -52,7 +52,7 @@ public class KnnSearchOpDispenser extends BaseOpenSearchOpDispenser {
|
||||
.index(targetF.apply(1))
|
||||
.query(new Query.Builder().knn(finalKnnfunc.apply(l).build()).build());
|
||||
|
||||
return (long l) -> new KnnSearchOp(clientF.apply(l), bfunc.apply(l).build(), Object.class);
|
||||
return (long l) -> new KnnSearchOp(clientF.apply(l), bfunc.apply(l).build(), Doc.class);
|
||||
}
|
||||
|
||||
private KnnQuery.Builder convertVector(KnnQuery.Builder builder, List list) {
|
||||
@ -63,5 +63,22 @@ public class KnnSearchOpDispenser extends BaseOpenSearchOpDispenser {
|
||||
return builder.vector(vector);
|
||||
}
|
||||
|
||||
public static class Doc {
|
||||
private float[] values;
|
||||
public Doc() {}
|
||||
public Doc(float[] values) {
|
||||
this.values = values;
|
||||
}
|
||||
public float[] getValues() {
|
||||
return values;
|
||||
}
|
||||
public void setValues(float[] values) {
|
||||
this.values = values;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{" + "values=" + values + "}";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,3 +21,4 @@ blocks:
|
||||
knn_search: TEMPLATE(indexname,vectors_index)
|
||||
k: 100
|
||||
vector: [1f,2f,3f,4f,5f,6f,7f,8f,9f,10f,11f,12f,13f,14f,15f,16f,17f,18f,19f,20f,21f,22f,23f,24f,25f]
|
||||
field: value
|
||||
|
Loading…
Reference in New Issue
Block a user