cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene or XPath search using date

ltardioli
Champ in-the-making
Champ in-the-making
Hello guys,

I'm trying to write a JavaScript code that returns all documents of some folder that was created 10 days ago.

I tried using Lucene Search for exemple:
var nodes = search.luceneSearch("@created:2012-06-05");
I know this query just returns things of this day, but how to get just the ones of 10 days ago;

Another problem is this query return results of all repository, I saw that I can pass a store path on this search, but how is a path of the current store that I'm executing this javascript?

Thanks guys!
1 REPLY 1

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
The syntax query is wrong… Check alfresco wiki page for search

Your code should look like:

var nodes = search.luceneSearch("@cm\:created:2012-06-05");

You'll need to do some dynamic thing to get the date for 10 days before and use a range query


var nodes = search.luceneSearch("@cm\:created:[2012\-06\-05T00:00:00 TO NOW]");

Adei