You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"This notebook shows how to use functionality related to the `Alibaba Cloud OpenSearch Vector Search Edition`.\n",
15
18
"To run, you should have an [OpenSearch Vector Search Edition](https://opensearch.console.aliyun.com) instance up and running:\n",
16
19
"- Read the [help document](https://www.alibabacloud.com/help/en/opensearch/latest/vector-search) to quickly familiarize and configure OpenSearch Vector Search Edition instance.\n"
17
-
],
18
-
"metadata": {
19
-
"collapsed": false
20
-
}
20
+
]
21
21
},
22
22
{
23
23
"cell_type": "markdown",
24
-
"source": [
25
-
"After completing the configuration, follow these steps to connect to the instance, index documents, and perform vector retrieval."
26
-
],
27
24
"metadata": {
28
25
"collapsed": false
29
-
}
26
+
},
27
+
"source": [
28
+
"After completing the configuration, follow these steps to connect to the instance, index documents, and perform vector retrieval."
" endpoint=\"The endpoint of opensearch instance, You can find it from the console of Alibaba Cloud OpenSearch.\",\n",
@@ -121,165 +129,145 @@
121
129
"# \"embedding\": \"embedding\",\n",
122
130
"# \"metadata\": \"metadata,=\" #The value field contains mapping name and operator, the operator would be used when executing metadata filter query\n",
123
131
"# })"
124
-
],
125
-
"metadata": {
126
-
"collapsed": false,
127
-
"pycharm": {
128
-
"name": "#%%\n"
129
-
}
130
-
},
131
-
"execution_count": 1,
132
-
"outputs": [
133
-
{
134
-
"ename": "NameError",
135
-
"evalue": "name 'AlibabaCloudOpenSearchSettings' is not defined",
"Cell \u001B[0;32mIn[1], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m settings \u001B[38;5;241m=\u001B[39m \u001B[43mAlibabaCloudOpenSearchSettings\u001B[49m(\n\u001B[1;32m 2\u001B[0m endpoint\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mThe endpoint of opensearch instance, You can find it from the console of Alibaba Cloud OpenSearch.\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[1;32m 3\u001B[0m instance_id\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mThe identify of opensearch instance, You can find it from the console of Alibaba Cloud OpenSearch.\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[1;32m 4\u001B[0m datasource_name\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mThe name of the data source specified when creating it.\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[1;32m 5\u001B[0m username\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mThe username specified when purchasing the instance.\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[1;32m 6\u001B[0m password\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mThe password specified when purchasing the instance.\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[1;32m 7\u001B[0m embedding_index_name\u001B[38;5;241m=\u001B[39m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mThe name of the vector attribute specified when configuring the instance attributes.\u001B[39m\u001B[38;5;124m\"\u001B[39m,\n\u001B[1;32m 8\u001B[0m field_name_mapping\u001B[38;5;241m=\u001B[39m{\n\u001B[1;32m 9\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mid\u001B[39m\u001B[38;5;124m\"\u001B[39m: \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mid\u001B[39m\u001B[38;5;124m\"\u001B[39m, \u001B[38;5;66;03m# The id field name map of index document.\u001B[39;00m\n\u001B[1;32m 10\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mdocument\u001B[39m\u001B[38;5;124m\"\u001B[39m: \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mdocument\u001B[39m\u001B[38;5;124m\"\u001B[39m, \u001B[38;5;66;03m# The text field name map of index document.\u001B[39;00m\n\u001B[1;32m 11\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124membedding\u001B[39m\u001B[38;5;124m\"\u001B[39m: \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124membedding\u001B[39m\u001B[38;5;124m\"\u001B[39m, \u001B[38;5;66;03m# The embedding field name map of index document.\u001B[39;00m\n\u001B[1;32m 12\u001B[0m \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mmetadata\u001B[39m\u001B[38;5;124m\"\u001B[39m: \u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mmetadata,=\u001B[39m\u001B[38;5;124m\"\u001B[39m \u001B[38;5;66;03m# The metadata field name map of index document.\u001B[39;00m\n\u001B[1;32m 13\u001B[0m })\n",
141
-
"\u001B[0;31mNameError\u001B[0m: name 'AlibabaCloudOpenSearchSettings' is not defined"
142
-
]
143
-
}
144
132
]
145
133
},
146
134
{
147
135
"cell_type": "markdown",
148
-
"source": [
149
-
"Create an opensearch access instance by settings."
150
-
],
151
136
"metadata": {
152
137
"collapsed": false
153
-
}
138
+
},
139
+
"source": [
140
+
"Create an opensearch access instance by settings."
141
+
]
154
142
},
155
143
{
156
144
"cell_type": "code",
157
145
"execution_count": null,
146
+
"metadata": {
147
+
"collapsed": false,
148
+
"pycharm": {
149
+
"name": "#%%\n"
150
+
}
151
+
},
158
152
"outputs": [],
159
153
"source": [
160
154
"# Create an opensearch instance and index docs.\n",
"If you encounter any problems during use, please feel free to contact <[email protected]>, and we will do our best to provide you with assistance and support.\n"
276
-
],
277
262
"metadata": {
278
263
"collapsed": false,
279
264
"pycharm": {
280
265
"name": "#%% md\n"
281
266
}
282
-
}
267
+
},
268
+
"source": [
269
+
"If you encounter any problems during use, please feel free to contact <[email protected]>, and we will do our best to provide you with assistance and support.\n"
0 commit comments