Nest always maps values in Dictionary to string

I've been trying to figure out how the dynamic mapping and templates work but not having much luck.

I have a simple app that loads in data file and maps it to a Dictionary<string, object>
the values are all technically strings though, which seems to be my problem.

I upload my data to the index the simplest way possible.
var response = m_client.Index(data, i => i.Index(index));

When I look at the data in elastic however, all the values are mapped to strings.

         "FooBar1" : "-2020",
          "FooBar2" : "1.320",
          "FooBar3" : "foobarvalue",

I read on some posts that elastic will only evaluate on first entry to the index, all my testing I create a brand new index, so that shouldn't be the issue.
My guess is that because it's passing the data as object (which is really a string when i parse the files) it decides to keep it as that.

is there any way to force elastic to evaluate the type? as I don't know what types the values will be I don't think I can set up a mapping for it? They're all base types, nothing that elastic shouldn't be able to parse.

I looked on stackoverflow and here, but most answers that came close to my issue, I didn't understand the answer.


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