I am fetching marketcatalogue data from betfair api-ng and I want to store it in to elasticsearch (v1.4.4).
The data coming from API contains lot of properties and complex types. There is a complex type named runners which contains related data and a Dictionary<string,string>
. I want to define such mapping so it will store data in Elasticsearch. Sample mapping is below:
"marketcatalogue" :{
"properties":{
"marketId":{"type":"string", "index": "not_analyzed" },
"marketName":{"type":"string", "analyzer":"keylower" },
"isMarketDataDelayed":{"type","boolean"},
"description":{
"persistenceEnabled":{"type","boolean"},
"bspMarket":{"type","boolean"},
"marketTime":{"type" : "date","format":"dateOptionalTime"},
"suspendTime":{"type" : "date","format":"dateOptionalTime"},
"settleTime":{"type" : "date","format":"dateOptionalTime"},
"bettingType":{"type":"integer"},
"turnInPlayEnabled":{"type","boolean"},
"marketType":{"type":"string", "analyzer":"keylower" },
"regulator":{"type":"string", "analyzer":"keylower" },
"marketBaseRate":{"type":"double"},
"discountAllowed":{"type","boolean"},
"wallet":{"type":"string", "analyzer":"keylower"},
"rules":{"type":"string"},
"rulesHasDate":{"type","boolean"},
"clarifications":{"type":"string"}
},
"runners":{
"selectionId":{"type":"long"},
"runnerName":{"type":"string", "analyzer":"keylower"},
"handicap":{"type":"double"},
"metadata":{
}
}
}
}
}
The medatadata is a Dictionary<string,string>
coming from the API and it can contain data like:
<"TRAINER_NAME", "John">, <"WEARING", "Wearing one">,....
Storing the data into type is not a big deal but the problem is how to define the mapping for the dictionary.
Any help will save lot of my time and will make me to learn the mapping creation the better way.
Thanks in advance.