0
沒有發現這是我NEST2.0 POCO聲明:Add()方法中NEST 2.0
[ElasticsearchType(Name = "MyDocument")]
public class MyDocument: DynamicResponse
{
[String(Store = false, Index = FieldIndexOption.NotAnalyzed)]
public string HistoryId{ get; set; }
[String(Store = false, Index = FieldIndexOption.NotAnalyzed)]
public string FileId { get; set; }
[Date(Store = false)]
public DateTime DateTime { get; set; }
}
,這是它的映射:
elastic.Map<MyDocument>(m => m
.Index(indexName)
.AutoMap().AllField(a => a.Enabled(false))
.Dynamic()
.DynamicTemplates(dt => dt
.Add(t => t
.Name("pv_values_template")
.Match("ch_*")
.Mapping(m2 => m2
.Number(n => n
.Store(false)
.Index(NonStringIndexOption.NotAnalyzed)
.DocValues(true))))));
貌似.Add()
方法沒有按」 (它與NEST 1.0工作正常)
Thanks @Rob。這部分解決了我的問題。使用批量寫入編寫這些文檔時,我仍然遇到一些問題。請看看這裏:http://stackoverflow.com/questions/35721566/bulk-write-on-elasticsearch-2-0-nest-2-0-throws-a-stackoverflow-exception –
我剛剛添加了一個編輯我的問題在這裏:http://stackoverflow.com/questions/35721566/bulk-write-on-elasticsearch-2-0-nest-2-0-throws-a-stackoverflow-exception –