根据this page,法语分析器定义了一个不区分大小写的省略步骤,如下所示:
...
"french_elision": {
"type": "elision",
"articles_case": true, // <==== Note this article case property
"articles": [
"l", "m", "t", "qu", "n", "s", "j", "d", "c", "jusqu", "quoiqu", "lorsqu", "puisqu"
]
},
...
在尝试在NEST(v6.6)中重新创建它时,我似乎遇到了障碍,因为ArticleCase调用似乎不存在。是不是只是作为一个错误?或者是否有其他方式应该这样做?
.Elision("french_elision", f => f
// .ArticlesCase(true) <==== Doesn't exist
.Articles("l", "m", "t", "qu", "n", "s", "j", "d", "c", "jusqu", "quoiqu", "lorsqu", "puisqu"))
我也在Articles()
或其他地方寻找一个bool,但我找不到它。我继续运行代码,默认情况下没有设置值。如何确保elision过滤器设置了此值?谢谢
从这里可以看出:https://github.com/elastic/elasticsearch-net/issues/3570
russcam说如下:
这是缺少的。我们将它添加到下一个版本中。
在此期间,您可以通过从ElisionTokenFilter
派生来添加它,并添加属性,例如
public class MyElisionTokenFilter : ElisionTokenFilter
{
[PropertyName("articles_case")]
public bool? ArticlesCase { get; set; }
}
并在您的设置中使用它
.UserDefined("french_elision", new MyElisionTokenFilter
{
ArticlesCase = true,
Articles = new[] { "l", "m", "t", "qu", "n", "s", "j", "d", "c", "jusqu", "quoiqu", "lorsqu", "puisqu" }
})