I'm using Nest to access ElasticSearch in C#. I've set up a structure that specifies ElasticProperty attributes to define the fields that are to be stored/indexed/sorted/etc. It all works great.
Now I've got a new requirement to save and search against additional "dynamic" data...
This new data works like this: my data structure (Item) can have multiple associated string labels, sorted into different sections. So a single Item might have Section1.Label1, Section1.Label2, Section2.Label1,
and Section3.Label4
.
If I were storing this in c#, I would probably use a Dictionary<string, List<string>>
to store it. But in ElasticSearch, I also need to be able to search against these labels like "Give me all items that have Section2.Label1". The labels won't need be analyzed (just existence or not).
Thanks for any leads you can offer to tell Nest how to store such a data field.
UPDATE #1: It look like I'm probably looking at some type of [ElasticProperty(Type = FieldType.Nested)] rather than a Dynamic Mapping. Should I just use a Dictionary<string, List<string>>
that's marked as a Nested type?