pymilvus offset参数不生效解决示例
作者:ponponon
这篇文章主要为大家介绍了pymilvus 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 }, 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 )
以上就是pymilvus offset参数不生效解决示例的详细内容,更多关于pymilvus offset参数的资料请关注脚本之家其它相关文章!