首页 > 解决方案 > 如何在 MS Teams 基于搜索的消息扩展请求中配置查询的分页参数?

问题描述

我正在使用基于 MS 团队搜索的消息扩展。

https://docs.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/search-commands/respond-to-search?tabs=dotnet#default-query 在默认查询中我得到 - "queryOptions": { "skip": 0, "count": 25 }

有没有办法自定义这个计数。

标签: botframeworkmicrosoft-teams

解决方案


我没有找到任何支持文档来更新,queryOptions但是您可以在代码中手动处理它,并设​​置最初要显示的项目数量以及搜索内容时的数量。最初运行消息扩展时,查询参数名称设置为"initialRun",所以这里你可以如何使用它

if (query.Parameters[0].Name == "initialRun")
{
    // Write the code handling number of results to be return.
}
else
{
    // Write the code handling number of results to be return when user search.
}

谢谢


推荐阅读