cancel
Showing results for 
Search instead for 
Did you mean: 

Query Lucene: get the birthday

ventus85
Champ in-the-making
Champ in-the-making
Hi all!

If I write this query

@myest\:birthday:"1998\-09\-24"

The results are all those lines of people who were born on that day, but I want people born that month and that day (no year).

@myest\:birthday:"*\-09\-24" and @myest\:birthday:"19*\-09\-24" not good

What is the right query?

Thank you.
3 REPLIES 3

andy
Champ on-the-rise
Champ on-the-rise
Hi

There is no support to do this at the moment for datetime (and the wildcards you could use will lower case and miss)
It is a reasonable extension to have constraints on the upper and lower bits of datetime used. At the moment you can ignore everything below hour etc etc)


For date the index contains tokens of the form
yyyy-MM-dd

If you quote it - you will get stuff tokenised and the * will fail to parser to a date

So

@myest\:birthday:????\-09\-24

should give you a wildcard query that matches (and does not have to be valid date)

Andy

ventus85
Champ in-the-making
Champ in-the-making
Thank you.
I solved by creating the node properties with day, month and year (individually).

My query is:

@myest\:month:"09" AND @myest\:day:"24"

andy
Champ on-the-rise
Champ on-the-rise
Hi

The date time analyser creates individual tokens for each field.
The problem is you can not query these direct.
At some point we will add some more date functions to expose this.

Andy