fixed condition when find options consist of vector only

This commit is contained in:
Mark Wolters 2024-05-10 18:00:13 -04:00
parent d5a96e81c4
commit e6d2c35f5a
4 changed files with 8 additions and 1 deletions

View File

@ -58,6 +58,8 @@ public class DataApiFindOneOpDispenser extends DataApiOpDispenser {
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) {

View File

@ -55,8 +55,11 @@ public class DataApiFindOpDispenser extends DataApiOpDispenser {
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) {

View File

@ -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"

View File

@ -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"