Skip to content

Commit

Permalink
fixed condition when find options consist of vector only
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkWolters committed May 10, 2024
1 parent d5a96e8 commit e6d2c35
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Expand Up @@ -58,6 +58,8 @@ private FindOneOptions getFindOneOptions(ParsedOp op, long l) {
float[] vector = getVectorValues(op, l);
if (sort != null) {
options = vector != null ? options.sort(vector, sort) : options.sort(sort);
} else if (vector != null) {
options = options.sort(vector);
}
Projection[] projection = getProjectionFromOp(op, l);
if (projection != null) {
Expand Down
Expand Up @@ -55,8 +55,11 @@ private LongFunction<DataApiFindOp> createOpFunction(ParsedOp op) {
private FindOptions getFindOptions(ParsedOp op, long l) {
FindOptions options = new FindOptions();
Sort sort = getSortFromOp(op, l);
float[] vector = getVectorValues(op, l);
if (sort != null) {
options = options.sort(sort);
options = vector != null ? options.sort(vector, sort) : options.sort(sort);
} else if (vector != null) {
options = options.sort(vector);
}
Projection[] projection = getProjectionFromOp(op, l);
if (projection != null) {
Expand Down
Expand Up @@ -19,6 +19,7 @@ blocks:
sort:
type: "asc"
field: "field1"
vector: "1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0"
projection:
include:
- "field1"
Expand Down
Expand Up @@ -19,6 +19,7 @@ blocks:
sort:
type: "asc"
field: "field1"
vector: "1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0"
projection:
include:
- "field1"
Expand Down

0 comments on commit e6d2c35

Please sign in to comment.