|
69 | 69 | ### Hybrid Search |
70 | 70 | 1. Supports multi-channel retrieval in a single SQL query, combining vector-based semantic search with keyword-based search for optimized recall. |
71 | 71 | 2. Query reranking supports weighted scores, Reciprocal Rank Fusion (RRF), and LLM-based reranking for enhanced results. |
72 | | -3. Scalar filters are pushed down to storage for optimized performance, and multi-table joins allow related data retrieval. |
| 72 | +3. Relational filters are pushed down to storage for optimized performance, and multi-table joins allow related data retrieval. |
73 | 73 |
|
74 | 74 | ### Vector & Full-Text Search |
75 | 75 | 1. Supports dense vectors and sparse vectors, with multiple distance metrics including Manhattan, Euclidean, inner product, and cosine similarity. |
@@ -137,7 +137,7 @@ Quickly experience OceanBase Cloud on AWS Marketplace - a highly scalable distri |
137 | 137 | Build a semantic search system in 5 minutes: |
138 | 138 |
|
139 | 139 | <details> |
140 | | -<summary><b>🗄️ 🐍 New Python SDK</b></summary> |
| 140 | +<summary><b>🗄️ 🐍 Python SDK</b></summary> |
141 | 141 |
|
142 | 142 | ```bash |
143 | 143 | # install sdk first |
@@ -265,66 +265,6 @@ print(f"\nDeleted collection '{collection_name}'") |
265 | 265 | Please refer to the [User Guide](https://github.com/oceanbase/pyseekdb) for more details. |
266 | 266 | </details> |
267 | 267 |
|
268 | | -<details> |
269 | | -<summary><b>🗄️ 🐍 Old Python SDK</b></summary> |
270 | | - |
271 | | -```bash |
272 | | -# install old sdk first, not recommended |
273 | | -pip install -U pyobvector |
274 | | -``` |
275 | | - |
276 | | -```python |
277 | | -from pyobvector import * |
278 | | - |
279 | | -# Don't support Embedded mode |
280 | | -client = MilvusLikeClient(uri="127.0.0.1:2881", user="test@test") |
281 | | - |
282 | | -test_collection_name = "ann_test" |
283 | | -# define the schema of collection with optional partitions |
284 | | -range_part = ObRangePartition(False, range_part_infos = [ |
285 | | - RangeListPartInfo('p0', 100), |
286 | | - RangeListPartInfo('p1', 'maxvalue'), |
287 | | -], range_expr='id') |
288 | | -schema = client.create_schema(partitions=range_part) |
289 | | -# define field schema of collection |
290 | | -schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True) |
291 | | -schema.add_field(field_name="embedding", datatype=DataType.FLOAT_VECTOR, dim=3) |
292 | | -schema.add_field(field_name="meta", datatype=DataType.JSON, nullable=True) |
293 | | -# define index parameters |
294 | | -idx_params = client.prepare_index_params() |
295 | | -idx_params.add_index( |
296 | | - field_name='embedding', |
297 | | - index_type=VecIndexType.HNSW, |
298 | | - index_name='vidx', |
299 | | - metric_type="L2", |
300 | | - params={"M": 16, "efConstruction": 256}, |
301 | | -) |
302 | | -# create collection |
303 | | -client.create_collection( |
304 | | - collection_name=test_collection_name, |
305 | | - schema=schema, |
306 | | - index_params=idx_params, |
307 | | -) |
308 | | - |
309 | | -# insert value |
310 | | -# prepare data |
311 | | -vector_value1 = [0.748479, 0.276979, 0.555195] |
312 | | -vector_value2 = [0, 0, 0] |
313 | | -data1 = [{'id': i, 'embedding': vector_value1} for i in range(10)] |
314 | | -data1.extend([{'id': i, 'embedding': vector_value2} for i in range(10, 13)]) |
315 | | -data1.extend([{'id': i, 'embedding': vector_value2} for i in range(111, 113)]) |
316 | | -# insert data |
317 | | -client.insert(collection_name=test_collection_name, data=data1) |
318 | | - |
319 | | -# do search |
320 | | -res = client.search(collection_name=test_collection_name, data=[0, 0, 0], anns_field='embedding', limit=5, output_fields=['id']) |
321 | | -# For example, the result will be: |
322 | | -# [{'id': 112}, {'id': 111}, {'id': 10}, {'id': 11}, {'id': 12}] |
323 | | - |
324 | | -``` |
325 | | -Please refer to the [User Guide](https://github.com/oceanbase/pyobvector) for more details. |
326 | | -</details> |
327 | | - |
328 | 268 | <details> |
329 | 269 | <summary><b>🗄️ SQL</b></summary> |
330 | 270 |
|
|
0 commit comments