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