Define elasticsearch mapping for a dictionary coming from the remote api
<p>I am fetching marketcatalogue data from betfair api-ng and I want to store it in to elasticsearch (v1.4.4). </p>

<p>The data coming from API contains lot of properties and complex types. There is a complex type named <strong>runners</strong> which contains related data and a <code>Dictionary&lt;string,string&gt;</code>. I want to define such mapping so it will store data in Elasticsearch. Sample mapping is below:</p>

<pre><code>"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":{

            }
        }
    }
}
</code></pre>

<p>}</p>

<p>The <strong>medatadata</strong> is a <code>Dictionary&lt;string,string&gt;</code> coming from the API and it can contain data like: </p>

<pre><code>&lt;"TRAINER_NAME", "John"&gt;, &lt;"WEARING", "Wearing one"&gt;,....
</code></pre>

<p>Storing the data into type is not a big deal but the problem is how to define the mapping for the dictionary. </p>

<p>Any help will save lot of my time and will make me to learn the mapping creation the better way. </p>

<p>Thanks in advance.</p>