feat(hybrid-search): support HYBRID_SEARCH SQL syntax for OceanBase 4… - #71
Merged
Conversation
….6.0 - add HybridSearch.sql_search() based on the HYBRID_SEARCH table function - add version-gated tests for the SQL-level hybrid search syntax - document the SQL-level DSL in README and add module to Sphinx index - replace Chinese literals in tests and docs with English
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for OceanBase 4.6.0’s SQL-level HYBRID_SEARCH table function to the pyobvector hybrid search client, with version-gated tests and updated documentation/examples (including English-only test/doc literals).
Changes:
- Add
HybridSearch.sql_search()that executesSELECT ... FROM HYBRID_SEARCH(TABLE ..., DSL_STRING)with version gating. - Add/extend tests for SQL-level hybrid search (KNN/match/hybrid/multi-knn/outer where+order) and update test literals to English.
- Document the SQL-level DSL in
README.mdand includepyobvector.client.hybrid_searchin Sphinx docs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ob_vec_client.py | Updates test collection name literal to English. |
| tests/test_json_table.py | Replaces Chinese SQL literals/aliases and expected rows with English equivalents. |
| tests/test_hybrid_search.py | Adds version-gated tests for sql_search and updates seed data/query strings to English. |
| tests/test_fts_index.py | Updates test literals to English; renames/adjusts IK parser test naming and assertions. |
| source/pyobvector.client.rst | Adds Sphinx automodule entry for pyobvector.client.hybrid_search. |
| README.md | Documents SQL-level HYBRID_SEARCH usage and provides DSL reference/restrictions. |
| pyobvector/json_table/virtual_data_type.py | Translates an inline comment to English (no logic change). |
| pyobvector/client/hybrid_search.py | Implements sql_search() and version check, plus identifier quoting helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- always include the __score column in sql_search projection, even when a subset of columns is requested - document that where/order_by are interpolated verbatim and must be trusted SQL fragments (SQL injection risk), prefer DSL filters for user-provided values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
….6.0
Summary
close #70
Solution Description