Elasticsearch Birthday field


(Arpan Sahoo) #1

I have a Birthday date-field (format: MMddyyyy||MMdd) in my index. I want to search for exact birthday that a user search for (eg. 03221989) and the upcoming birthdays. I am able to get the exact birthday. But for upcoming birthdays, i tried:

Range query - "gte" : "now" -> it won't work as now will also have a year field and I want to find 03221989 type Birthdays as well
Range query - "gte" : "03221989" -> with this i am able to sort the records in ascending order of Month
Suppose in my index, I have 3 records as:
"Birthday": "03221979"
"Birthday": "05271988"
"Birthday": "04161990"
I want the elasticsearch query to return me in ascending order of month irrespective of year. Return data should be:
"Birthday": "03221979"
"Birthday": "04161990"
"Birthday": "05271988"

Kindly someone help me on this..


(Eduardo González de la Herrán) #2

Duplicated topic:

Let's follow up from one place.

Regards,
Eduardo


(system) #3

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