NEST 7.x 中 AnalyzeAsync 的替代品是什么?

What is a replacement for AnalyzeAsync in NEST 7.x?

我将我的应用程序从 Nest 版本 6.8 更新到 7.3,发现目前不支持 AnalyzeAsync 方法。以下代码的替代品是什么?

var analyzeRequest = new AnalyzeRequest(_elasticSearchSettings.PatentFamilyIndexName)
            {
                Analyzer = analyzer,
                Text = new[] {wordsList}
            };
var analyzeResponse = await ElasticClient.AnalyzeAsync(analyzeRequest)

在 NEST 7.x 中,API 方法已归类到与

相关的功能区域下
var client = new ElasticClient();

var analyzeRequest = new AnalyzeRequest(_elasticSearchSettings.PatentFamilyIndexName)
{
    Analyzer = analyzer,
    Text = new[] { wordsList }
};

var analyzeResponse = await client.Indices.AnalyzeAsync(analyzeRequest);

这使 NEST 与 REST API 规范中的分组以及其他客户端保持一致。你可以 read more about the changes in the 7.x release blog post.