Nest 2、Elasticsearch 2.3 中 FuzzyMinimumSimilarity 的替代品是什么?

What is the replacement for FuzzyMinimumSimilarity in Nest 2, Elasticsearch 2.3?

我正在升级到 Nest 2(elasticsearch 1.x 到 2.3),但请注意 FuzzyMinimumSimilarity 和 OnFieldsWithBoost 消失的重大更改。我应该如何将下面的代码替换为 Nest v2?

new SearchDescriptor<T>().Type(searchTypes).Query(q =>q.QueryString(qs => qs.Query(fuzzy).FuzzyMinimumSimilarity(0.7)));

对于FuzzyMaxExpansions(0.7)

这里是fuzziness options available on query_string query in NEST 2.x(使用最新的2.5.8)

var client = new ElasticClient();

var searchResponse = client.Search<MyDocument>(s => s
    .Query(q => q
        .QueryString(qs =>qs
            .Fields(f => f
                .Field(ff => ff.Name, 3)
                .Field(ff => ff.Content, 0.5)
            )
            .Query("fuzzy")
            .Fuzziness(Fuzziness.EditDistance(3))
            .FuzzyMaxExpansions(2)
            .FuzzyPrefixLength(4)
            .FuzzyRewrite(MultiTermQueryRewrite.TopTerms(3))
        )
    )
);

产生

{
  "query": {
    "query_string": {
      "query": "fuzzy",
      "fuzzy_max_expansions": 2,
      "fuzziness": 3,
      "fuzzy_prefix_length": 4,
      "fields": [
        "name^3",
        "content^0.5"
      ],
      "fuzzy_rewrite": "top_terms_3"
    }
  }
}

另请查看 release blog post and breaking changes between 1.x and 2.x 文档