elasticsearch - Index template with wildcard type names -


as can read on this section official documentation, can set wildcards in index names, have tested , works fine, but, there way can same type names?. example

{     "user": {         "template": "user-*",         "settings": {             "index.number_of_shards": 5,             "index.number_of_replicas": 1         },         "mappings": {              "info": {                  "dynamic": "strict",                  "properties": {                      ...                  }             }             "more": {                  "template": "more-*",                  "_parent": {                     "type": "info"                  },                  "dynamic": "strict",                  "properties": {                      ...                  }             }         }     } } 

thise example doesn't work, sure, hope there way can it.

update: second aproximation

{     "user": {         "template": "user-*",         "settings": {             "index.number_of_shards": 5,             "index.number_of_replicas": 1         },         "mappings": {                 "info": {                     "dynamic": "strict",                  "properties": {                         ...                     }                }             "more-*": {                     "_parent": {                     "type": "info"                  },                     "dynamic": "strict",                  "properties": {                         ...                     }                }            }        }    } 

but when try create type "more-2015" inside "user-0" index (/user-0/more-2015/) next exception:

org.elasticsearch.elasticsearchillegalargumentexception: can't specify parent if no parent field has been configured

so want have different types exact same mapping ?

from doc

a type in elasticsearch represents class of similar documents. type consists of name—such user or blogpost—and mapping. mapping, database schema, describes fields or properties documents of type may have, datatype of each field—such string, integer, or date—and how fields should indexed , stored lucene

you wouldn't have different classnames, same structure. has said in comment, cannot have wildcard in type name, because wouldn't make sense.

from can see, use year dimension. have considered having 1 index per year, , types info & more-info ?


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -