0
我使用了NEST客戶端的語法如下:NEST AGGS集合是隻讀
_server.Search<Document>(s => s.Index(_config.SearchIndex)
.Query(q => q.MatchAll(p => p)).Aggregations(
a => a
.Terms("type", st => st
.Field(p => p.Type)
)));
不過,我不斷收到以下異常
A first chance exception of type 'System.NotSupportedException' occurred in mscorlib.dll
Additional information: Collection is read-only.
似乎只有當我出現m使用聚合,字段類型有以下映射:
[Keyword(Name = "Type")]
public string Type { get; set; }
你能告訴我你是怎麼訪問的結果,是你試圖改變結果對象? – pratikvasa
您使用的是哪個版本的NEST,以及您定位的是哪個版本的Elasticsearch? –
我有同樣的問題..可以解決這個問題。問題在於響應的反序列化。 JSON.NET中的異常來源。 @Imran Azad,你最終怎麼解決這個問題? –