Multiple context instances - elasticsearch - nested objects


#1

Hey snowplowers,

I know it’s possible to pass multiple contexts of the same type with a Snowplow event, but by default these are stored in ES as an array of objects. This presents problems when querying because of the way Lucene flattens arrays, which prevents correlating field combinations in single objects.

I’m looking at adding a mapping for my specific context field as a nested type in ES but (AFAIK) there’s no way of making that a default because the context field name (com_snowplow_blah_0) is determined by the schema name and therefore not known in advance.

I wondered if anyone had tackled this problem before and tried this approach? Or whether it’s not worth trying and better resolved by modelling the events in SQL later on.