Skip to content

Commit

Permalink
Add version restriction, lint fix to knn test
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Keeler <[email protected]>
  • Loading branch information
alex-keeler committed Aug 28, 2024
1 parent 9b115b5 commit 1779bb6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/default/_core/search/knn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ prologues:
director: Bennett Miller
title: Moneyball
year: 2011
embedding: [1.4, 3.5, 2.3, 4.1, 9.2]
embedding: [1.4, 2.3, 3.5, 4.1, 9.2]
status: [201]
epilogues:
- path: /movies
Expand All @@ -50,7 +50,7 @@ chapters:
query:
knn:
embedding:
vector: [1.4, 3.5, 2.3, 4.1, 9.2]
vector: [1.4, 2.3, 3.5, 4.1, 9.2]
k: 1
response:
status: 200
Expand All @@ -67,9 +67,10 @@ chapters:
director: Bennett Miller
title: Moneyball
year: 2011
embedding: [1.4, 3.5, 2.3, 4.1, 9.2]
embedding: [1.4, 2.3, 3.5, 4.1, 9.2]

- synopsis: Search using the min_score parameter.
version: '>= 2.14'
path: /{index}/_search
parameters:
index: movies
Expand All @@ -79,7 +80,7 @@ chapters:
query:
knn:
embedding:
vector: [1.4, 3.5, 2.3, 4.1, 9.2]
vector: [1.4, 2.3, 3.5, 4.1, 9.2]
min_score: 0.9
response:
status: 200
Expand All @@ -96,9 +97,10 @@ chapters:
director: Bennett Miller
title: Moneyball
year: 2011
embedding: [1.4, 3.5, 2.3, 4.1, 9.2]
embedding: [1.4, 2.3, 3.5, 4.1, 9.2]

- synopsis: Search using the max_distance parameter.
version: '>= 2.14'
path: /{index}/_search
parameters:
index: movies
Expand All @@ -108,7 +110,7 @@ chapters:
query:
knn:
embedding:
vector: [1.4, 3.5, 2.3, 4.1, 9.2]
vector: [1.4,2.3, 3.5, 4.1, 9.2]
max_distance: 0.1
response:
status: 200
Expand All @@ -125,7 +127,7 @@ chapters:
director: Bennett Miller
title: Moneyball
year: 2011
embedding: [1.4, 3.5, 2.3, 4.1, 9.2]
embedding: [1.4, 2.3, 3.5, 4.1, 9.2]

- synopsis: Search using a filter.
path: /{index}/_search
Expand All @@ -137,7 +139,7 @@ chapters:
query:
knn:
embedding:
vector: [1.4, 3.5, 2.3, 4.1, 9.2]
vector: [1.4, 2.3, 3.5, 4.1, 9.2]
k: 1
filter:
term:
Expand Down

0 comments on commit 1779bb6

Please sign in to comment.