【发布时间】:2020-11-22 21:23:47
【问题描述】:
我在搜索弹性时遇到问题。我使用 NEST 库进行搜索,并尝试获取以“GÖKDEMİR”开头的 customername 字段的记录(例如)
var response = await _elasticClient.SearchAsync<AccountAddressInfo>(p => p
.Query(q => q
.MatchPhrasePrefix(m => m
.Field(f => f.CustomerName)
.Query(filter.CustomerName)
)
)
.Size(101));
通过此搜索,我在customername 字段中获得了包含“GÖKDEMİR”的响应记录,但我想获得以“GÖKDEMİR”开头的字段。
我该怎么做。
【问题讨论】:
-
customerName字段的映射是什么? -
映射用于属性名称,它在启动时配置。数据类型没有 mappimg
标签: string elasticsearch search .net-core nest