【发布时间】:2019-11-12 16:55:57
【问题描述】:
我正在调查搜索结果与预期不符的错误,并发现这是因为未应用提升。
查询是使用 NEST (6.6.0) 使用以下代码生成的:
queryContainer = new MultiMatchQuery
{
Fuzziness = Fuzziness.Auto,
Query = querystring,
Type = TextQueryType.BestFields,
Fields = Infer.Fields<RecipeSearchModel>(
f1 => Infer.Field<RecipeSearchModel>(f => f.Title, 5),
f2 => f2.Description,
f3 => Infer.Field<RecipeSearchModel>(f => f.Ingredients, 3),
f4 => f4.Method,
f5 => Infer.Field<RecipeSearchModel>(f => f.Image.Alt, 4))
};
但是生成的查询没有应用任何提升。:
"multi_match": {
"fields": [
"title",
"description",
"ingredients",
"method",
"image.alt"
],
"fuzziness": "AUTO",
"query": "chocolate",
"type": "best_fields"
}
从我从documentation 中得知,这似乎是正确的,为什么这不起作用?
【问题讨论】:
标签: c# elasticsearch nest