错误写法
def search_vector(vector: list[float], offset: int = 0, limit: int = 10) -> list[SearchResult]:
from pymilvus.orm.search import SearchResult as MilvusSearchResult
from loggers import logger
logger.debug(f'offset: {offset}, limit: {limit}')
rows: MilvusSearchResult = collection.search(
data=[vector],
param={
"metric_type": 'L2',
"nprobe": 32
},
anns_field='image_vector',
output_fields=['id', 'hash_code'],
limit=limit,
offset=offset
)
正确的写法
def search_vector(vector: list[float], offset: int = 0, limit: int = 10) -> list[SearchResult]:
from pymilvus.orm.search import SearchResult as MilvusSearchResult
from loggers import logger
logger.debug(f'offset: {offset}, limit: {limit}')
rows: MilvusSearchResult = collection.search(
data=[vector],
param={
"metric_type": 'L2',
"nprobe": 32,
"offset": offset
},
anns_field='image_vector',
output_fields=['id', 'hash_code'],
limit=limit,
# offset=offset
)
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。