It is that possible to I return in my Elasticsearch query a new field ( that does not exist in the mapping ), with a new format from other field ?
something like that -
This is my Mapping -
PUT /user-product-2023-06-02
{
"mappings": {
"properties": {
"count_product_add": {
"type": "float"
},
"timestamp": {
"type": "date",
"format": "yyyy-MM-dd"
}
}
}
}
If I make a search it will returns -
{
"_index": "user-product-2023-06-02",
"_id": "epSBjYkB3MOuw-Z1lEDX",
"_score": 2,
"_source": {
"timestamp": "2023-06-03",
"count_product_add": 2,
}
},
{
"_index": "user-product-2023-06-02",
"_id": "e5SBjYkB3MOuw-Z1lEDX",
"_score": 2,
"_source": {
"timestamp": "2023-07-05",
"count_product_add": 5,
}
},
I wold like to return a new field with the day and month , and get those values from the time stamp . something like that -
{
"_index": "user-product-2023-06-02",
"_id": "epSBjYkB3MOuw-Z1lEDX",
"_score": 2,
"_source": {
"timestamp": "2023-06-03",
"day": "03",
"month": "06",
"count_product_add": 2,
}
},
{
"_index": "user-product-2023-06-02",
"_id": "e5SBjYkB3MOuw-Z1lEDX",
"_score": 2,
"_source": {
"timestamp": "2023-06-05",
"day": "06",
"month": "05",
"count_product_add": 5,
}
},
It is that possible ?