Skip to content

Commit

Permalink
Rename "rescore" to "rescore_vector"
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Dec 5, 2024
1 parent a8633e5 commit ef8ac8c
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ setup:
query_vector: [ 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0 ]
k: 3
num_candidates: 3
"rescore":
"rescore_vector":
"oversample": 2.0

# We expect the knn search ops + rescoring num_cnaidates (for rescoring) per shard
Expand All @@ -122,7 +122,7 @@ setup:
k: 3
num_candidates: 3
similarity: 100000.0
"rescore":
"rescore_vector":
"oversample": 2.0

# We expect the knn search ops + rescoring num_cnaidates (for rescoring) per shard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ setup:
query_vector: [-0.5, 90.0, -10, 14.8, -156.0]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Compare scores as hit IDs may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ setup:
query_vector: [ 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Get rescoring scores - hit ordering may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ setup:
num_candidates: 3
field: vector
query_vector: [0.5, 111.3, -13.0, 14.8, -156.0]
rescore:
rescore_vector:
oversample: 1.5

# Get rescoring scores - hit ordering may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ setup:
query_vector: [-0.5, 90.0, -10, 14.8]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Get rescoring scores - hit ordering may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ setup:
query_vector: [ 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0, -0.5, 90.0, -10, 14.8, -156.0]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Get rescoring scores - hit ordering may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ setup:
query_vector: [-0.5, 90.0, -10, 14.8, -156.0]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Compare scores as hit IDs may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ setup:
query_vector: [-0.5, 90.0, -10, 14.8]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Get rescoring scores - hit ordering may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ setup:
query_vector: [-0.5, 90.0, -10, 14.8, -156.0]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Get rescoring scores - hit ordering may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ setup:
query_vector: [127.0, -128.0, 0.0, 1.0, -1.0]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Compare scores as hit IDs may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ setup:
query_vector: [127, 127, -128, -128, 127]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Compare scores as hit IDs may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ setup:
query_vector: [127, 127, -128, -128, 127]
k: 3
num_candidates: 3
rescore:
rescore_vector:
oversample: 1.5

# Compare scores as hit IDs may change depending on how things are distributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public final class KnnRetrieverBuilder extends RetrieverBuilder {
public static final ParseField QUERY_VECTOR_FIELD = new ParseField("query_vector");
public static final ParseField QUERY_VECTOR_BUILDER_FIELD = new ParseField("query_vector_builder");
public static final ParseField VECTOR_SIMILARITY = new ParseField("similarity");
public static final ParseField RESCORE_FIELD = new ParseField("rescore");
public static final ParseField RESCORE_VECTOR_FIELD = new ParseField("rescore_vector");

@SuppressWarnings("unchecked")
public static final ConstructingObjectParser<KnnRetrieverBuilder, RetrieverParserContext> PARSER = new ConstructingObjectParser<>(
Expand Down Expand Up @@ -96,7 +96,7 @@ public final class KnnRetrieverBuilder extends RetrieverBuilder {
PARSER.declareField(
optionalConstructorArg(),
(p, c) -> RescoreVectorBuilder.fromXContent(p),
RESCORE_FIELD,
RESCORE_VECTOR_FIELD,
ObjectParser.ValueType.OBJECT
);
RetrieverBuilder.declareBaseParserFields(NAME, PARSER);
Expand Down Expand Up @@ -281,7 +281,7 @@ public void doToXContent(XContentBuilder builder, Params params) throws IOExcept
}

if (rescoreVectorBuilder != null) {
builder.field(RESCORE_FIELD.getPreferredName(), rescoreVectorBuilder);
builder.field(RESCORE_VECTOR_FIELD.getPreferredName(), rescoreVectorBuilder);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class KnnSearchBuilder implements Writeable, ToXContentFragment, Rewritea
public static final ParseField NAME_FIELD = AbstractQueryBuilder.NAME_FIELD;
public static final ParseField BOOST_FIELD = AbstractQueryBuilder.BOOST_FIELD;
public static final ParseField INNER_HITS_FIELD = new ParseField("inner_hits");
public static final ParseField RESCORE_FIELD = new ParseField("rescore");
public static final ParseField RESCORE_VECTOR_FIELD = new ParseField("rescore_vector");

@SuppressWarnings("unchecked")
private static final ConstructingObjectParser<KnnSearchBuilder.Builder, Void> PARSER = new ConstructingObjectParser<>("knn", args -> {
Expand Down Expand Up @@ -89,7 +89,7 @@ public class KnnSearchBuilder implements Writeable, ToXContentFragment, Rewritea
PARSER.declareField(
optionalConstructorArg(),
(p, c) -> RescoreVectorBuilder.fromXContent(p),
RESCORE_FIELD,
RESCORE_VECTOR_FIELD,
ObjectParser.ValueType.OBJECT
);
PARSER.declareFieldArray(
Expand Down Expand Up @@ -547,7 +547,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.field(NAME_FIELD.getPreferredName(), queryName);
}
if (rescoreVectorBuilder != null) {
builder.field(RESCORE_FIELD.getPreferredName(), rescoreVectorBuilder);
builder.field(RESCORE_VECTOR_FIELD.getPreferredName(), rescoreVectorBuilder);
}

return builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class KnnVectorQueryBuilder extends AbstractQueryBuilder<KnnVectorQueryBu
public static final ParseField VECTOR_SIMILARITY_FIELD = new ParseField("similarity");
public static final ParseField FILTER_FIELD = new ParseField("filter");
public static final ParseField QUERY_VECTOR_BUILDER_FIELD = new ParseField("query_vector_builder");
public static final ParseField RESCORE_FIELD = new ParseField("rescore");
public static final ParseField RESCORE_VECTOR_FIELD = new ParseField("rescore_vector");

public static final ConstructingObjectParser<KnnVectorQueryBuilder, Void> PARSER = new ConstructingObjectParser<>(
"knn",
Expand Down Expand Up @@ -104,7 +104,7 @@ public class KnnVectorQueryBuilder extends AbstractQueryBuilder<KnnVectorQueryBu
PARSER.declareField(
optionalConstructorArg(),
(p, c) -> RescoreVectorBuilder.fromXContent(p),
RESCORE_FIELD,
RESCORE_VECTOR_FIELD,
ObjectParser.ValueType.OBJECT
);
PARSER.declareFieldArray(
Expand Down Expand Up @@ -406,7 +406,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep
builder.endArray();
}
if (rescoreVectorBuilder != null) {
builder.field(RESCORE_FIELD.getPreferredName(), rescoreVectorBuilder);
builder.field(RESCORE_VECTOR_FIELD.getPreferredName(), rescoreVectorBuilder);
}
boostAndQueryNameToXContent(builder);
builder.endObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class RescoreVectorBuilder implements Writeable, ToXContentObject {
public static final ParseField OVERSAMPLE_FIELD = new ParseField("oversample");
public static final float MIN_OVERSAMPLE = 1.0F;
private static final ConstructingObjectParser<RescoreVectorBuilder, Void> PARSER = new ConstructingObjectParser<>(
"rescore",
"rescore_vector",
args -> new RescoreVectorBuilder((Float) args[0])
);

Expand Down

0 comments on commit ef8ac8c

Please sign in to comment.