Problem:
When having a custom serializer with a Newtonsoft.Json.Converters.StringEnumConverter in place, the document is indexed properly, but when creating a search request including a term for the enum field, the value of the enum is serialized as an integer instead of a string.
Steps to reproduce:
Create a NEST client with a custom serializer based derived from ConnectionSettingsAwareSerializerBase. Use StringEnumConverter.
Create an index and sample document including an enum. Cross check the enum has been serialized as a string.
Create a search request, including a term with the enum. The enum value is serialized as an integer instead of a string.
Valid NEST response built from a successful low level call on PUT: /sample/sampledoc/11586a12341446d89c9ba71ac583ff94
# Audit trail of this API call:
- [1] HealthyResponse: Node: http://localhost:9200/ Took: 00:00:00.1091068
# Request:
{"id":"11586a12341446d89c9ba71ac583ff94","someEnum":"Two"}
# Response:
{"_index":"sample","_type":"sampledoc","_id":"11586a12341446d89c9ba71ac583ff94","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":4,"_primary_term":1}
Search-Result:
Valid NEST response built from a successful low level call on POST: /sample/sampledoc/_search
# Audit trail of this API call:
- [1] HealthyResponse: Node: http://localhost:9200/ Took: 00:00:00.1071065
# Request:
{"query":{"term":{"someEnum":{"value":2}}}}
# Response:
{"took":0,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
NEST/Elasticsearch.Net version: 6.0.0-beta1
Elasticsearch version: 6.1.1
Problem: When having a custom serializer with a Newtonsoft.Json.Converters.StringEnumConverter in place, the document is indexed properly, but when creating a search request including a term for the enum field, the value of the enum is serialized as an integer instead of a string.
Steps to reproduce:
See attached csharp source file. Programm.txt
Index-Result:
Search-Result: