AnsweredAssumed Answered

Query Search with space and range date parameter

Question asked by ant_batt on Mar 19, 2010
Latest reply on Mar 29, 2010 by rscottm
Hi to all,

I have a problem. I want to search, with Web Service, a content that have a date range (that user insert in input) and are present in a specific space.
I have try with this code, but the result is a ResultsSet of content that are present in a space that I don't want



SimpleDateFormat df = CachingDateFormat.getDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", true);
Calendar cal = Calendar.getInstance();
String dateF = df.format(cal.getTime());
cal.add(Calendar.MONTH, -1);
String dateI = df.format(cal.getTime());
String path="'+PATH:\"/app:company_home/cm:portale/cm:Istruzione/cm:Contenuti/cm:Home/cm:normativa/*\" + ";
String range="@cm\\:created:[" + dateI + " TO " + dateF +"]'";
String str=path+range;
Query query = new Query(Constants.QUERY_LANG_LUCENE, str);
QueryResult queryResult = repositoryService.query(STORE, query, false);

Thanks

Outcomes