ScalaMapFieldExtractor Cannot extract value from entity

It seams that the solution is to use and additional map stage, as suggested in https://discuss.elastic.co/t/cannot-extract-value-from-entity/66556

rdd.map({case Some(subscriptionInfo) => subscriptionInfo}).saveToEs("spark/docs", Map("es.mapping.id" -> "sub_id"))