AnsweredAssumed Answered

can't make lucene query work

Question asked by mrks.js on Sep 29, 2011
Latest reply on Sep 30, 2011 by andy
Hello folks,


I am facing some problems with querying lucene.

Following my construct:
// search construct
var sort1 = {
column: "@{http://www.alfresco.org/model/content/1.0}created",
ascending: true
};
var paging = {
maxItems: 100,
skipCount: 0
};
var def = {
query: "@cm\\:created:[\"" + splitd1 + "*\" TO \"" + splitd2 +"*\"]",
store: "workspace://SpacesStore/"+item,
language: "fts-alfresco",
sort: [sort1],
page: paging
};

var candidates = search.query(def);
splitd1 and splitd2 are two date-strings that i have manipulated. One represents the actual time and the other represents a date one week before the actual time.

I want to find all files that have been created in the last week (from now on).

According to the alfresco reository javascript debugger the query looks like this:
@cm\:created:["2011\-09\-29*" TO "2011\-09\-22*"]

But the method is not returning any result!

However, if i enter the string above in the lucene search field in the node browser of my alfresco installation it works perfectly fine.

What am I missing? Do i have to escape some more characters because of lucenes syntax?
help needed. thanks in advance!


// alfresco 3.2 community

Outcomes