开发者

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(
  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

上一篇:

下一篇:

精彩评论

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

最新开发

开发排行榜