【发布时间】:2014-04-30 10:17:29
【问题描述】:
我通过 ElasticSearch Sense 浏览器插件创建了下面的索引,还创建了 C# Nest Fluent Mapping。除了 nGrams 过滤器上的“token_chars”之外,我可以在 Nest 中表达所有内容。我没有在 C# 嵌套上获得强类型属性来添加“token_chars”。有人遇到过同样的问题吗?
json 和 c# 设置如下所示。 请帮忙
"analysis": {
"analyzer": {
"str_index_analyzer": {
"filter": [
"lowercase",
"substring"
],
"tokenizer": "keyword"
},
"filter": {
"substring": {
"max_gram": "50",
"type": "nGram",
"min_gram": "2",
"token_chars": [ /*Not able to map */
"letter",
"digit"
]
}
}
我没有在 C# 嵌套上获得强类型属性来添加“token_chars”。有人遇到同样的问题吗?
var result = this._client.CreateIndex("mkfindex1", c => c
.Analysis(a => a.Analyzers(an => an.Add("str_index_analyzer", new CustomAnalyzer()
{
Filter = new string[] { "lowercase", "substring" },
Tokenizer = "keyword"
})).TokenFilters(bases => bases.Add("substring", new NgramTokenFilter()
{
MaxGram = 50,
MinGram = 2,
/*"token_chars": [//Not able to map
"letter",
"digit"
*/
}))));
【问题讨论】:
-
介意为此添加一个 github 问题吗? github.com/elasticsearch/elasticsearch-net/…
标签: elasticsearch nest