简体   繁体   English

在 NEST C# 中验证 Elasticsearch 查询字符串

[英]Validation of Elasticsearch query string in NEST C#

We are migrating from Elasticsearch 5.6 to es 7.5.我们正在从 Elasticsearch 5.6 迁移到 es 7.5。 Together with this migration we are migrating NEST library as well.与此迁移一起,我们也在迁移 NEST 库。

In 5.6 we were using validations like this:在 5.6 中,我们使用了这样的验证:

...

Nest.ElasticClient client = ...
Nest.QueryContainer query = ...

client.ValidateQuery<T>(v => v.Query(q => query));

But according to this document , all methods to validate query were removed from 7.x lib and there is no info how to use NEST client in this case.但是根据此文档,所有验证查询的方法都从 7.x 库中删除,并且在这种情况下没有关于如何使用 NEST 客户端的信息。

Is there some way how to validate our queries using Nest.ElasticClient ?有什么方法可以使用Nest.ElasticClient验证我们的查询吗?

It has been moved to Indices part of the client methods.它已移至客户端方法的Indices部分。

client.Indices.ValidateQuery(..)

Hope that helps.希望有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM