Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Jul 3, 2023
1 parent ad886ac commit ff1b78a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,12 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

if (this.parameters != null) {
generator.writeKey("parameters");
generator.writeStartObject();
for (Map.Entry<String, JsonData> item0 : this.parameters.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);
}
generator.writeEnd();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

}
if (this.knnAlgoParamEfSearch != null) {
generator.writeKey("knn.algo_param_ef_search");
generator.writeKey("knn.algo_param.ef_search");
generator.write(this.knnAlgoParamEfSearch);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ public void testCanIndexAndSearchKnn() throws Exception {

assertEquals(2, hits.size());
assertEquals(5.5f, hits.get(0).source().price, 0.01f);
assertEquals(4.4f, hits.get(1).source().price, 0.01f);
assertEquals(10.3f, hits.get(1).source().price, 0.01f);
}

private static class Doc {
public float[] vector;
public float price;

Doc() {

}

Doc(float[] vector, float price) {
this.vector = vector;
this.price = price;
Expand Down

0 comments on commit ff1b78a

Please sign in to comment.