-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
NEST/Elasticsearch.Net version: (Originally tested on 2.4.5) 2.5.0
Elasticsearch version: 2.4.0
Description of the problem including expected versus actual behavior:
I am trying to deserialize my ES query which has an include
field containing an array of strings. The
query is working in Kibana Sense but throws an exception when trying to deserialize. The error occurs when serializing the aggregations section.
Here is the query:
{
"aggs": {
"sizes": {
"terms": {
"field": "size",
"size": 20,
"include": [
"35",
"50",
"70",
"75",
"100"
]
}
}
}
}
Steps to reproduce:
1.
Elasticsearch.Net.IElasticsearchSerializer.Deserialize<SearchRequest>(new MemoryStream(Encoding.UTF8.GetBytes(query)))
- Exception is thrown.
Provide DebugInformation
(if relevant):
Exception thrown:
- An exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Newtonsoft.Json.dll but was not handled in user code
Additional information: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Nest.TermsIncludeExclude' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
Metadata
Metadata
Assignees
Labels
No labels