Mapping types _type or type or both


(Hobo Joe) #1

Is type, as used below, being removed from elasticsearch?

PUT _template/dogpound_mpds
{
"index_patterns": ["dogpound_mpds*"],
"mappings" : {
    "_doc" : {
        "dynamic": "true",
        "properties": {
          "twitter": {"type": "text","fields": {"keyword": {"type": "keyword","ignore_above": 256}}},
          "cowboy": {"type": "text","fields": {"keyword": {"type": "keyword","ignore_above": 256}}},
          "start": {"type": "date"}
          "duration": {"type": "integer"}
        }
    }
},
"aliases": {
    "dogpound_mpds": {}
}
}

(Mark Walkom) #2

Your formatting is not the best, can you wrap the code in markdown style backticks?


(Hobo Joe) #3

like that?


(Mark Walkom) #4

Great, thanks!

The mapping type is not going anywhere.
The _doc type above is what is changing.


(Hobo Joe) #5

I am trying to prepare for the removal of mapping types.

https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html

I thought by using "_doc" I was headed in the right direction?

Can you explain?


(Hobo Joe) #6

don't forget about me?


(Mark Walkom) #7

You are.
By only having one _type, that is _doc, when we remove _types completely you are already prepared.

What do you mean?


(Hobo Joe) #8

I am concerned that now I will have trouble with "_doc". I think I still have a fundamental misunderstanding about what it means to have mapping types removed. Your initial response seems to indicate I will have problems because something is changing with "_doc"?


(Hobo Joe) #9

still with me?


(David Pilato) #10

Read this and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.


(Mark Walkom) #11

In that example you gave you have two "types";

  1. the type referring to the mapping of a specific field. This is not changing
  2. the _type referring to the mapping of a document variant

The second one is changing.

What do you mean?


(system) closed #12

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.