Skip to content

Commit c2c516b

Browse files
HNSW index: drop type suffix from condition, Java can overload methods
Also make the legacy QueryBuilder condition public after all.
1 parent eb04e09 commit c2c516b

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

objectbox-java/src/main/java/io/objectbox/Property.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public PropertyQueryCondition<ENTITY> between(double lowerBoundary, double upper
316316
* use maxResultCount of 100 with a Query limit of 10 to have 10 results that are of potentially better quality than
317317
* just passing in 10 for maxResultCount (quality/performance tradeoff).
318318
*/
319-
public PropertyQueryCondition<ENTITY> nearestNeighborsF32(float[] queryVector, int maxResultCount) {
319+
public PropertyQueryCondition<ENTITY> nearestNeighbors(float[] queryVector, int maxResultCount) {
320320
return new NearestNeighborCondition<>(this, queryVector, maxResultCount);
321321
}
322322

objectbox-java/src/main/java/io/objectbox/query/PropertyQueryConditionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ public NearestNeighborCondition(Property<T> property, float[] queryVector, int m
475475

476476
@Override
477477
void applyCondition(QueryBuilder<T> builder) {
478-
builder.nearestNeighborsF32(property, queryVector, maxResultCount);
478+
builder.nearestNeighbors(property, queryVector, maxResultCount);
479479
}
480480
}
481481
}

objectbox-java/src/main/java/io/objectbox/query/Query.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,23 +796,23 @@ public Query<T> setParameter(String alias, byte[] value) {
796796
}
797797

798798
/**
799-
* Sets parameters previously given to {@link Property#nearestNeighborsF32(float[], int)}.
799+
* Sets parameters previously given to {@link Property#nearestNeighbors(float[], int)}.
800800
*
801801
* @param property Property reference from generated entity underscore class, like {@code Example_.example}.
802802
*/
803-
public Query<T> setParametersNearestNeighborsF32(Property<?> property, float[] queryVector, int maxResultCount) {
803+
public Query<T> setParametersNearestNeighbors(Property<?> property, float[] queryVector, int maxResultCount) {
804804
checkOpen();
805805
nativeSetParameter(handle, property.getEntityId(), property.getId(), null, queryVector);
806806
nativeSetParameter(handle, property.getEntityId(), property.getId(), null, maxResultCount);
807807
return this;
808808
}
809809

810810
/**
811-
* Sets parameters previously given to {@link Property#nearestNeighborsF32(float[], int)}.
811+
* Sets parameters previously given to {@link Property#nearestNeighbors(float[], int)}.
812812
*
813813
* @param alias as defined using {@link PropertyQueryCondition#alias(String)}.
814814
*/
815-
public Query<T> setParametersNearestNeighborsF32(String alias, float[] queryVector, int maxResultCount) {
815+
public Query<T> setParametersNearestNeighbors(String alias, float[] queryVector, int maxResultCount) {
816816
checkOpen();
817817
nativeSetParameter(handle, 0, 0, alias, queryVector);
818818
nativeSetParameter(handle, 0, 0, alias, maxResultCount);

objectbox-java/src/main/java/io/objectbox/query/QueryBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ public QueryBuilder<T> between(Property<T> property, double value1, double value
898898
return this;
899899
}
900900

901-
QueryBuilder<T> nearestNeighborsF32(Property<T> property, float[] queryVector, int maxResultCount) {
901+
public QueryBuilder<T> nearestNeighbors(Property<T> property, float[] queryVector, int maxResultCount) {
902902
verifyHandle();
903903
checkCombineCondition(nativeNearestNeighborsF32(handle, property.getId(), queryVector, maxResultCount));
904904
return this;

0 commit comments

Comments
 (0)