forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: zhengxiu <zhengxiu@huawei.com> Co-committed-by: zhengxiu <zhengxiu@huawei.com>
30 lines
1.5 KiB
HTML
30 lines
1.5 KiB
HTML
<a name="EN-US_TOPIC_0000001960517829"></a><a name="EN-US_TOPIC_0000001960517829"></a>
|
|
|
|
<h1 class="topictitle1">How Do I Create a Type Under an Index in an Elasticsearch 7.<em id="i244964613435">x</em> Cluster of CSS?</h1>
|
|
<div id="body0000001475380637"><p id="EN-US_TOPIC_0000001960517829__p191317614588">In Elasticsearch 7.<em id="EN-US_TOPIC_0000001960517829__i20425185815430">x</em> and later versions, types cannot be created for indexes.</p>
|
|
<p id="EN-US_TOPIC_0000001960517829__p448714591548">If you need to use types, add <strong id="EN-US_TOPIC_0000001960517829__b19816173174513">include_type_name=true</strong> to the command. Only a single type is supported.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001960517829__screen3576324641">PUT index?<strong id="EN-US_TOPIC_0000001960517829__b163051120182819">include_type_name=true</strong>
|
|
{
|
|
"mappings": {
|
|
"my_type": {
|
|
"properties": {
|
|
"@timestamp": {
|
|
<strong id="EN-US_TOPIC_0000001960517829__b494312281">"type": "date"</strong>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}</pre>
|
|
<p id="EN-US_TOPIC_0000001960517829__p18810502221">After a multi-type index is created, run the following command to write data into it:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001960517829__screen173705322211">PUT index/my_type/1
|
|
{
|
|
"@timestamp":"2019-02-20"
|
|
}</pre>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_02_0055.html">Using CSS Cluster Search Engines</a></div>
|
|
</div>
|
|
</div>
|
|
|