Questions tagged [elasticsearch-date]
7 questions
4
votes
1 answer
Convert timestamps to datetime for use in Elasticsearch aggregations
I have an index of SendGrid event data:
"_source": {
"externalId": "9283cc1d-b003-xxxx-a5af-84fcf31c4181",
"email": "test@test.com",
"timestamp": 1616515214,
"event": "processed",
"uid": null,
"id": null,
…

Alex
- 1,857
- 3
- 36
- 51
2
votes
2 answers
Elasticsearch custom date time format incl. ordinal numbers
I need to define the format for the date field in my index
{
"mappings": {
"properties": {
"date": {
"type": "date",
"format": "???"
}
}
}
}
to cover values like February 10th 2021, 23:59:58.556.
I tried MMMM…

user13145920
- 179
- 1
- 9
2
votes
1 answer
Partial search on date fields in elasticsearch
I'm trying to implement partial search on a date field in elastic search. For example if startDate is stored as "2019-08-28" i should be able to retrieve the same while querying just "2019" or "2019-08" or "2019-0".
For other fields i'm doing…

Aman Mahra
- 23
- 3
1
vote
1 answer
How can I index a date field with the default value of "now"?
I need to add a date field type such that the document will take the current system date time as the default value. I'm using Elasticsearch 7.5.
PUT /myindex/_mappings
{
"properties": {
"create_date": {
"type": "date",
…

Elmehdi ELGHALI
- 15
- 6
0
votes
0 answers
Date histogram aggregation seems incorrect with calendar_interval and when offset >= 30 days
Based on this doc, elasticsearch supports Calendar-aware interval on data histogram aggregation. Specially for a "quarter" interval:
"One quarter is the interval between the start day of the month and time of day and the same day of the month and…
0
votes
1 answer
Elasticsearch string matching multiple fields in query
I'm trying to query my Elastic Search database and match several fields, however, I get:
[match] malformed query, expected [END_OBJECT] but found [FIELD_NAME]
Which is strange because surely I must be able to use match and then my field name to…

Ryan H
- 2,620
- 4
- 37
- 109
0
votes
1 answer
Elastic query aggregate by specified time range a day
Hi I need to write a specific query that will aggregate data by work shifts in selected time range during days. The issue is I do not want to specify all the ranges directly in date_range aggregation, just want to specify the from -> to time range…

Martin Hudec
- 61
- 9