Skip to content

Commit b6b9179

Browse files
authored
Merge pull request #23 from longdafeng/master
Fixed #21, [Enhancement]: remove old python sdk demo in the Readme
2 parents bdf9152 + 509f5fc commit b6b9179

File tree

2 files changed

+3
-123
lines changed

2 files changed

+3
-123
lines changed

README.md

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
### Hybrid Search
7070
1. Supports multi-channel retrieval in a single SQL query, combining vector-based semantic search with keyword-based search for optimized recall.
7171
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.
7373

7474
### Vector & Full-Text Search
7575
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
137137
Build a semantic search system in 5 minutes:
138138

139139
<details>
140-
<summary><b>🗄️ 🐍 New Python SDK</b></summary>
140+
<summary><b>🗄️ 🐍 Python SDK</b></summary>
141141

142142
```bash
143143
# install sdk first
@@ -265,66 +265,6 @@ print(f"\nDeleted collection '{collection_name}'")
265265
Please refer to the [User Guide](https://github.com/oceanbase/pyseekdb) for more details.
266266
</details>
267267

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-
328268
<details>
329269
<summary><b>🗄️ SQL</b></summary>
330270

README_CN.md

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ rpm -ivh seekdb-1.x.x.x-xxxxxxx.el8.x86_64.rpm
146146
在 5 分钟内构建语义搜索系统:
147147

148148
<details>
149-
<summary><b>🗄️ 🐍 新版 Python SDK</b></summary>
149+
<summary><b>🗄️ 🐍 Python SDK</b></summary>
150150

151151
```bash
152152
# install sdk first
@@ -273,66 +273,6 @@ print(f"\nDeleted collection '{collection_name}'")
273273
更多详情请参考[用户指南](https://github.com/oceanbase/pyseekdb)
274274
</details>
275275

276-
<details>
277-
<summary><b>🗄️ 🐍 旧版 Python SDK</b></summary>
278-
279-
```bash
280-
# install old sdk first, not recommended
281-
pip install -U pyobvector
282-
```
283-
284-
```python
285-
from pyobvector import *
286-
287-
# Don't support Embedded mode
288-
client = MilvusLikeClient(uri="127.0.0.1:2881", user="test@test")
289-
290-
test_collection_name = "ann_test"
291-
# define the schema of collection with optional partitions
292-
range_part = ObRangePartition(False, range_part_infos = [
293-
RangeListPartInfo('p0', 100),
294-
RangeListPartInfo('p1', 'maxvalue'),
295-
], range_expr='id')
296-
schema = client.create_schema(partitions=range_part)
297-
# define field schema of collection
298-
schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True)
299-
schema.add_field(field_name="embedding", datatype=DataType.FLOAT_VECTOR, dim=3)
300-
schema.add_field(field_name="meta", datatype=DataType.JSON, nullable=True)
301-
# define index parameters
302-
idx_params = client.prepare_index_params()
303-
idx_params.add_index(
304-
field_name='embedding',
305-
index_type=VecIndexType.HNSW,
306-
index_name='vidx',
307-
metric_type="L2",
308-
params={"M": 16, "efConstruction": 256},
309-
)
310-
# create collection
311-
client.create_collection(
312-
collection_name=test_collection_name,
313-
schema=schema,
314-
index_params=idx_params,
315-
)
316-
317-
# insert value
318-
# prepare data
319-
vector_value1 = [0.748479, 0.276979, 0.555195]
320-
vector_value2 = [0, 0, 0]
321-
data1 = [{'id': i, 'embedding': vector_value1} for i in range(10)]
322-
data1.extend([{'id': i, 'embedding': vector_value2} for i in range(10, 13)])
323-
data1.extend([{'id': i, 'embedding': vector_value2} for i in range(111, 113)])
324-
# insert data
325-
client.insert(collection_name=test_collection_name, data=data1)
326-
327-
# do search
328-
res = client.search(collection_name=test_collection_name, data=[0, 0, 0], anns_field='embedding', limit=5, output_fields=['id'])
329-
# For example, the result will be:
330-
# [{'id': 112}, {'id': 111}, {'id': 10}, {'id': 11}, {'id': 12}]
331-
332-
```
333-
更多详情请参考[用户指南](https://github.com/oceanbase/pyobvector)
334-
</details>
335-
336276
<details>
337277
<summary><b>🗄️ SQL</b></summary>
338278

0 commit comments

Comments
 (0)