AnsweredAssumed Answered

Lucene date query

Question asked by swejja on Oct 19, 2009
Latest reply on Oct 19, 2009 by swejja

I am working on a custom model for a contract notification system for a client. We need to make a lucene query to get all contracts that has a startdate between two dates. I have read and tried everything I can find in the forum and in the wiki.

If I do an ordinary date search with an startdate and enddate it works (in this specific query I get two nodes as a result)
@sssb\:ContractStartDate:[2009\-09\-01T00:00:00 TO 2009\-10\-20T00:00:00]

But I would really like to be able to use the daterange function below

@sssb\:ContractStartDate:${luceneDateRange(today, "P1Y")} 
(Found in: and

I have tried all kinds of different character escapes and syntaxes to get it right but I dont get it to work.
@sssb\:ContractStartDate:$[luceneDateRange(today, "-P10Y")] 
@sssb\:ContractStartDate:$[luceneDateRange(today, \"P100Y\")] 

What am I doing wrong? We are using Alfresco (Version: Community - v3.2.0 (2268))

Best regards, Joakim