|
435 | 435 | " query_embedding = get_embeddings(user_query, mode, \"query\")\n", |
436 | 436 | "\n", |
437 | 437 | " # Define an aggregation pipeline consisting of a $vectorSearch stage, followed by a $project stage\n", |
438 | | - " # Set the number of candidates to 50 and only return the top 5 documents from the vector search\n", |
| 438 | + " # Set the number of candidates to 20 and only return the top 5 documents from the vector search\n", |
439 | 439 | " # Set the `filter` field in the $vectorSearch stage to the value `filter` passed to the function\n", |
440 | 440 | " # In the $project stage, exclude the `_id` field, include these fields: `title`, `cover`, `year`, `pages`, and the `vectorSearchScore`\n", |
441 | 441 | " # NOTE: Use variables defined previously for the `index`, `queryVector` and `path` fields in the $vectorSearch stage\n", |
|
445 | 445 | " \"index\": ATLAS_VECTOR_SEARCH_INDEX_NAME,\n", |
446 | 446 | " \"queryVector\": query_embedding,\n", |
447 | 447 | " \"path\": \"embedding\",\n", |
448 | | - " \"numCandidates\": 50,\n", |
| 448 | + " \"numCandidates\": 20,\n", |
449 | 449 | " \"filter\": filter,\n", |
450 | 450 | " \"limit\": 5,\n", |
451 | 451 | " }\n", |
|
816 | 816 | " \"index\": ATLAS_VECTOR_SEARCH_INDEX_NAME,\n", |
817 | 817 | " \"path\": \"embedding\",\n", |
818 | 818 | " \"queryVector\": get_embeddings(user_query, \"text\", \"query\"),\n", |
819 | | - " \"numCandidates\": 50,\n", |
| 819 | + " \"numCandidates\": 20,\n", |
820 | 820 | " \"limit\": 10,\n", |
821 | 821 | " }\n", |
822 | 822 | " },\n", |
|
967 | 967 | ], |
968 | 968 | "metadata": { |
969 | 969 | "kernelspec": { |
970 | | - "display_name": "base", |
| 970 | + "display_name": "Python 3", |
971 | 971 | "language": "python", |
972 | 972 | "name": "python3" |
973 | 973 | }, |
|
981 | 981 | "name": "python", |
982 | 982 | "nbconvert_exporter": "python", |
983 | 983 | "pygments_lexer": "ipython3", |
984 | | - "version": "3.11.6" |
| 984 | + "version": "3.9.6" |
985 | 985 | }, |
986 | 986 | "widgets": { |
987 | 987 | "application/vnd.jupyter.widget-state+json": { |
|
0 commit comments