0
我试图通过Nest 5.5.0设置“not_analyzed”索引类型,我不知道如何去做。为Nest 5.5.0中的属性设置not_analyzed
我的初始化:
var map = new CreateIndexDescriptor(INDEX_NAME)
.Mappings(ms => ms.Map<Project>(m => m.AutoMap()));
var connectionSettings = new ConnectionSettings().DefaultIndex(INDEX_NAME);
_client = new ElasticClient(connectionSettings);
_client.Index(map);
和项目类:
[ElasticsearchType(Name = "project")]
public class Project
{
public Guid Id { get; set; }
[Text(Analyzer = "not_analyzed")]
public string OwnerIdCode { get; set; }
}
的init这种方式产生了一些很怪的映射后,我通过邮差调用索引/ _mapping REST。有正常的“映射”JSON部分,并且在“createindexdescriptor”下面几乎具有相同的数据。
"examinations4": {
"mappings": {
"project": {
(...)
},
"createindexdescriptor": {
"properties": {
"mappings": {
"properties": {
"project": {
"properties": {
"properties": {
"properties": {
"id": {
"properties": {
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"ownerIdCode": {
"properties": {
"analyzer": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
(...)
非常感谢!我只是无法弄清楚如何通过使用“入门”文档来应对初始化。 ;) – mikes