Skip to content

Commit a02a69f

Browse files
committed
use non-deprecated version
1 parent a18c960 commit a02a69f

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

billion-scale-image-search/src/main/java/ai/vespa/examples/Centroids.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public List<Centroid> prune(List<Centroid> centroids, double factor) {
124124
private Query buildNNQuery(int k, int extraK, Tensor queryVector, Duration timeout) {
125125
NearestNeighborItem nn = new NearestNeighborItem("reduced_vector", "q_reduced");
126126
nn.setAllowApproximate(true);
127-
nn.setTargetNumHits(k);
127+
nn.setTargetHits(k);
128128
nn.setHnswExploreAdditionalHits(extraK);
129129
Query query = new Query();
130130
query.setTimeout(timeout.toMillis());

billion-scale-vector-search/src/main/java/ai/vespa/examples/ClusteringComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public List<Centroid> prune(List<Centroid> centroids, double factor) {
145145
private Query buildNNQuery(int k, int extraK, Tensor queryVector, Duration timeout) {
146146
NearestNeighborItem nn = new NearestNeighborItem("vector", "q");
147147
nn.setAllowApproximate(true);
148-
nn.setTargetNumHits(k);
148+
nn.setTargetHits(k);
149149
nn.setHnswExploreAdditionalHits(extraK);
150150
Query query = new Query();
151151
query.setTimeout(timeout.toMillis());

news/app-6-recommendation-with-searchers/src/main/java/ai/vespa/example/UserProfileSearcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Result search(Query query, Execution execution) {
2525

2626
// Create a new search using the user's embedding tensor
2727
NearestNeighborItem nn = new NearestNeighborItem("embedding", "user_embedding");
28-
nn.setTargetNumHits(query.getHits());
28+
nn.setTargetHits(query.getHits());
2929
nn.setAllowApproximate(true);
3030

3131
//Note that we only override the query tree, other native request parameters are intact

news/app-7-parent-child/src/main/java/ai/vespa/example/UserProfileSearcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Result search(Query query, Execution execution) {
2525

2626
// Create a new search using the user's embedding tensor
2727
NearestNeighborItem nn = new NearestNeighborItem("embedding", "user_embedding");
28-
nn.setTargetNumHits(query.getHits());
28+
nn.setTargetHits(query.getHits());
2929
nn.setAllowApproximate(true);
3030

3131
query.getModel().getQueryTree().setRoot(nn);

text-image-search/src/main/java/ai/vespa/example/TextEmbeddingSearcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public Result search(Query query, Execution execution) {
4343
// Set up the nearest neighbor retrieval
4444
NearestNeighborItem nn = new NearestNeighborItem("vit_b_32_image", "vit_b_32_text");
4545
nn.setAllowApproximate(true);
46-
nn.setTargetNumHits(10);
46+
nn.setTargetHits(10);
4747
nn.setHnswExploreAdditionalHits(100);
4848
query.getModel().getQueryTree().setRoot(nn);
4949

0 commit comments

Comments
 (0)