【发布时间】:2018-11-05 15:03:09
【问题描述】:
我正在使用 nest 创建我的 Elasticsearch 索引。我有两个问题:
问题 1. 如何添加设置以使用英语分析器和标准分析器的后备?
这就是我创建索引的方式:
Uri _node = new Uri("elasticUri");
ConnectionSettings _connectionSettings = new ConnectionSettings(_node)
.DefaultIndex("MyIndexName")
.DefaultMappingFor<POCO>(m => m
.IndexName("MyIndexName")
);
IElasticClient _elasticClient = new ElasticClient(_connectionSettings);
var createIndexResponse = _elasticClient.CreateIndex("MyIndexName", c => c
.Mappings(m => m
.Map<POCO>(d => d.AutoMap())
)
);
查看示例Here,我也不确定应该为 "english_keywords"、"english_stemmer" 等传递什么
问题 2:如果我使用 English Analyzer,Elasticsearch 会自动识别出“Barbecue”和“BBQ”这两个词是同义词吗?还是我需要明确地将同义词列表传递给 ES?
【问题讨论】:
标签: elasticsearch nest