Shakirov Ramil
Shakirov Ramil

Reputation: 1543

Opensearch field mapping as a map

What's the right way to map field as a MAP.

e.g. we have a json

{ "name": "app", "data": {"f1": {}, "f2": "v1"}}

{ "name": "app2", "data": {"f1": 1, "f2": "v2"}}

{ "name": "app3", "data": {"f1": "v3", "f2": "v4", "f3": [1,2,3]}}

Normally I prefer flattened(elastic), flat_object(openSearch) for my data field. But I have only openSearch version 1.3. What's the right way to set the field type for 'data' field.

I'm thinking about do mapping like KEY as keyword, and VALUE as text (doesn't matter of type of value). But I don't know how to do this mapping in opensearch.

in index it's like

data.f1 = "{}", data.f2 = "v1"
data.f1 = "1", data.f2 = "v2"
data.f1 = "v2", data.f2 = "v4", data.f3 = "[1,2,3]"

Upvotes: 0

Views: 30

Answers (0)

Related Questions