[C# NEST] Query results with special characters not mapping properly

When performing queries on indices that have field names with special characters, they are not correctly mapped to the provided model.

Example index:

        "_index" : "my-index-with-special-characters",
        "_id" : "",
        "_score" : 1.0,
        "_source" : {
            "host.ip" : "",

Example model:

public class myModel {
    public string HostIp { get; set; }

Example query:

var esAssets = ElasticAuth.Client("my-index-with-special-characters")
               .Search<myModel>(s => s

There are several fields in this index that do not have the "." character that map correctly, but each one that has the dot character does no map at all.

Is there a special way this case needs to be handled?

Thank you!

I seemed to have found an answer. Declaring a Nest.PropertyName above each field with a special character seems to do the trick.

public string HostIp { get; set; }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.