As I understand, when creating an index, you can define the fields that the documents will have in that index by defining a mapping
PUT person
{
"mappings": {
"properties": {
"firstName":{"type":"text"},
"secondName":{"type":"text"},
"age":{"type":"integer"}
}
}
}
But I also find a that queries are sometimes written like this, with a _doc
inside the mapping
PUT person
{
"mappings": {
"_doc":{
"properties": {
"firstName":{"type":"text"},
"secondName":{"type":"text"},
"age":{"type":"integer"}
}
}
}
}
What does putting _doc
do?