Skip to content

Commit 266e660

Browse files
author
Ziqun Ye
committed
update markdown
1 parent 0c87aaa commit 266e660

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

ai_services/semantic_search/Use_of_Cohere_embed_models_for_Semantic_Search_in_OCI_OpenSearch.ipynb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"### Prerequesites\n",
1111
"- You have a Running Instance of OCI Search\n",
1212
"\n",
13-
"To check how to spin up an instance of OCI search, see [Search and visualize data using OCI Search Service with OpenSearch](https://docs.oracle.com/en/learn/oci-opensearch/index.html#introduction)"
13+
"To check how to spin up an instance of OCI search, see [Search and visualize data using OCI Search Service with OpenSearch](https://docs.oracle.com/en/learn/oci-opensearch/index.html#introduction).\n",
14+
"\n",
15+
"Check [this link](https://lucene.apache.org/core/8_9_0/core/org/apache/lucene/codecs/lucene87/package-summary.html#package.description) to learn some basic concept of terms used in OpenSearch."
1416
]
1517
},
1618
{
@@ -188,7 +190,10 @@
188190
"metadata": {},
189191
"source": [
190192
"\n",
191-
"A new query coming in, first calcualte the embedding vector."
193+
"A new query coming in, first calcualte the embedding vector and then search.\n",
194+
"\n",
195+
"- `k`: the number of neighbors the search will return\n",
196+
"- `size`: (required) how many results the query actually returns. The plugin returns k amount of results for each shard (and each segment) and size amount of results for the entire query. The plugin supports a maximum k value of 10,000."
192197
]
193198
},
194199
{
@@ -200,7 +205,14 @@
200205
"query_vector = oci_embedings.embed_query(texts=\"how to build the html documentation\")\n",
201206
"query = {\n",
202207
" \"size\": 2,\n",
203-
" \"query\": {\"knn\": {VECTOR_1_NAME: {\"vector\": query_vector, \"k\": 2}}},\n",
208+
" \"query\": {\n",
209+
" \"knn\": {\n",
210+
" VECTOR_1_NAME: {\n",
211+
" \"vector\": query_vector, \n",
212+
" \"k\": 2\n",
213+
" }\n",
214+
" }\n",
215+
" },\n",
204216
"}\n",
205217
" \n",
206218
"response = es.search(body=query, index=INDEX_NAME) # the same as before\n",

0 commit comments

Comments
 (0)