Skip to content

Commit 669d92b

Browse files
committed
Fix chunks query
1 parent 4977622 commit 669d92b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

budgetkey_api/modules/search.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,17 @@ def apply_term(self, term, text_fields, multi_match_type='most_fields', multi_ma
8484
embedding = embedding.data[0].embedding
8585
for type_name in self.types:
8686
chunks = dict(
87-
knn=dict(
88-
field="chunks.embeddings",
89-
query_vector=embedding,
90-
k=10,
91-
num_candidates=50,
92-
boost=0.5
87+
nested=dict(
88+
path="chunks",
89+
query=dict(
90+
knn=dict(
91+
field="chunks.embeddings",
92+
query_vector=embedding,
93+
k=10,
94+
num_candidates=50,
95+
boost=0.5
96+
)
97+
)
9398
)
9499
)
95100
should = self.must(type_name)[-1]

0 commit comments

Comments
 (0)