Ho provato a definire la proprietà _timestamp
in un indice. Quindi, prima, creo l'indiceElasticsearch _timestamp
curl -XPUT 'http://elasticsearch:9200/ppe/'
risposta dal server: {"ok":true,"acknowledged":true}
poi ho cercato di definire la mappatura con una _timestamp
curl -Xput 'http://elasticsearch:9200/ppe/log/_mapping' -d '{
"log": {
"properties": {
"_ttl": {
"enabled": true
},
"_timestamp": {
"enabled": true,
"store": "yes"
},
"message": {
"type": "string",
"store": "yes"
},
"appid": {
"type": "string",
"store": "yes"
},
"level": {
"type": "integer",
"store": "yes"
},
"logdate": {
"type": "date",
"format": "date_time_no_millis",
"store": "yes"
}
}
}
}'
e ricevo come risposta da the server
{
"error": "MapperParsingException[No type specified for property [_timestamp]]",
"status": 400
}
Cosa c'è di sbagliato nella mia mappatura?
Ho pensato per molto tempo che le mie impostazioni di "_timestamp" sull'indice non erano corrette o qualcosa del genere perché i miei documenti non tornavano con questo campo. Grazie per aver reso nota la nota "Si noti che '_timestamp' deve essere esplicitamente richiesto da 'fields = _timestamp' o 'fields = _timestamp, _source'.", Questo mi ha davvero aiutato! –
@JesseWebb: sei il benvenuto! –