Skip to content

Commit 06f84bb

Browse files
committed
Corrected the json response
1 parent cae644c commit 06f84bb

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

notebooks/search/02-hybrid-search.ipynb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,20 @@
280280
"response = client.search(\n",
281281
" index=\"book_index\",\n",
282282
" size=5,\n",
283-
" query={\"match\": {\"summary\": \"python programming\"}},\n",
284-
" knn={\n",
285-
" \"field\": \"title_vector\",\n",
286-
" \"query_vector\": model.encode(\n",
287-
" \"python programming\"\n",
288-
" ).tolist(), # generate embedding for query so it can be compared to `title_vector`\n",
289-
" \"k\": 5,\n",
290-
" \"num_candidates\": 10,\n",
291-
" },\n",
292-
" retriever={\"rrf\": {}},\n",
283+
" retriever={\n",
284+
" \"rrf\": {\n",
285+
" \"retrievers\": [\n",
286+
" {\"standard\": {\"query\": {\"match\": {\"summary\": \"python programming\"}}}},\n",
287+
" {\"knn\": {\n",
288+
" \"field\": \"title_vector\",\n",
289+
" \"query_vector\": model.encode(\"python programming\").tolist(),\n",
290+
" \"k\": 5,\n",
291+
" \"num_candidates\": 10\n",
292+
" }}\n",
293+
" ]\n",
294+
" }\n",
295+
" }\n",
293296
")\n",
294-
"\n",
295297
"pretty_response(response)"
296298
]
297299
}

0 commit comments

Comments
 (0)