Skip to content

[Feature Request] Add advanced ANN query options in oceanbase #3649

@fengju0213

Description

@fengju0213

Required prerequisites

Motivation

ObVecClient ann_search supports multiple distance functions (l2_distance,cosine_distance, inner_product, negative_inner_product) and SQLAlchemy where_clause filtering, but OceanBaseStorage.query() currently exposes only l2/cosine and does not allow filters.

Solution

  • Extend distance to include inner_product and negative_inner_product and map them
    to the corresponding SQLAlchemy functions.
    • Add an optional where_clause parameter to OceanBaseStorage.query() and pass it
      through to ann_search.
    • Update OceanBase storage docs and example code to show a filtered ANN query using
      sqlalchemy.text or SQLAlchemy expressions.

reference: https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000004476154#8-title-DML%20%E6%93%8D%E4%BD%9C

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

P1Task with middle level priority

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions