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..