开发者

pymilvus offset参数不生效解决示例

开发者 https://www.devze.com 2023-11-09 11:12 出处:网络 作者: ponponon
目录错误写法正确的写法错误写法 def search_vector(vector: list[float], offset: int = 0, limit: int = 10) -> list[SearchResult]:
目录
  • 错误写法
  • 正确的写法

错误写法

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(
  php      data=[vector],
        param={
            "metric_type": 'L2',
            "nprobe": 32
        },
        anns_field='image_vector',
        output_fields=['id', 'hash_code'],
        limit=limit,
        offset=offset
    )

正确的写法

def search_vectopythonr(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":python 32,
            "offset": offset
        },
        anns_field='image_vector',
        output编程客栈_fields=['id', 'hash_code'],
        limit=limit,
        # offset=offset
    )

以上就是pymilvus offset参数不生效解决示例的详细内容,更多关于pymilvus offset参数的资料请关注编程客栈(www.devze.com)其它相关文章!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号