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
Copy file name to clipboardExpand all lines: README.md
+172-5Lines changed: 172 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,10 +33,11 @@ For detailed release notes and changelog, see [RELEASE_NOTES.md](RELEASE_NOTES.m
33
33
34
34
## Usage
35
35
36
-
`pyobvector` supports two modes:
36
+
`pyobvector` supports three modes:
37
37
38
38
-`Milvus compatible mode`: You can use the `MilvusLikeClient` class to use vector storage in a way similar to the Milvus API
39
39
-`SQLAlchemy hybrid mode`: You can use the vector storage function provided by the `ObVecClient` class and execute the relational database statement with the SQLAlchemy library. In this mode, you can regard `pyobvector` as an extension of SQLAlchemy.
40
+
-`Hybrid Search mode`: You can use the `HybridSearch` class to perform hybrid search that combines full-text search and vector similarity search, with Elasticsearch-compatible query syntax.
40
41
41
42
### Milvus compatible mode
42
43
@@ -210,22 +211,21 @@ res = self.client.ann_search(
210
211
The `ann_search` method supports flexible output column selection through the `output_columns` parameter:
211
212
212
213
-**`output_columns`** (recommended): Accepts SQLAlchemy Column objects, expressions, or a mix of both
-**`output_column_names`** (legacy): Accepts list of column name strings
219
-
- Example: `['id', 'name', 'meta']`
220
220
221
+
- Example: `['id', 'name', 'meta']`
221
222
-**Parameter Priority**: `output_columns` takes precedence over `output_column_names` when both are provided
222
-
223
223
-**`distance_threshold`** (optional): Filter results by distance threshold
224
+
224
225
- Type: `Optional[float]`
225
226
- Only returns results where `distance <= threshold`
226
227
- Example: `distance_threshold=0.5` returns only results with distance <= 0.5
227
228
- Use case: Quality control for similarity search, only return highly similar results
228
-
229
229
- If you want to use pure `SQLAlchemy` API with `OceanBase` dialect, you can just get an `SQLAlchemy.engine` via `client.engine`. The engine can also be created as following:
- For further usage in pure `SQLAlchemy` mode, please refer to [SQLAlchemy](https://www.sqlalchemy.org/)
266
+
267
+
### Hybrid Search Mode
268
+
269
+
`pyobvector` supports hybrid search that combines full-text search and vector similarity search, with query syntax compatible with Elasticsearch. This allows you to perform semantic search with both keyword matching and vector similarity in a single query.
270
+
271
+
- setup a client:
272
+
273
+
```python
274
+
from pyobvector import*
275
+
from pyobvector.client.hybrid_search import HybridSearch
0 commit comments