cancel
Showing results for 
Search instead for 
Did you mean: 

Still having problems with datetime resolution queries (FTS/CMIS)

mreyem
Champ in-the-making
Champ in-the-making
Hi there,
I'm currently using Alfresco Community 4.2.c and after a lot of battles I still cannot query my document using datetime resolution. These are the steps that I performed:

1) Setting Lucene as indexing system
2) Changed datetime analyzer to  d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser as said in (http://wiki.alfresco.com/wiki/CMIS_Query_Language)
3) Performed a full reindex (even 3 times)

Results:

I have 2 docs in my repo: doc A with creationDate = '2014-03-26T14:19:48:42' and doc B with creationDate = '2014-03-26T14:19:49:46'

The documents get correctly sorted using datetime resolution (before changing the analyzer even the sorting didn't work properly), meaning that a doc A is correctly put before doc B in an ASC ordering.
However the search does not work properly. I've tried both CMIS and FTS and If i query for document @cm:created:'2014-03-26T14:19:48' o cmis:creationDate <= TIMESTAMP '2014-03-26T14:19:48:42.000+00:00' I keep getting both doc A and doc B instead of just doc A

What am I doing wrong?
2 REPLIES 2

openpj
Elite Collaborator
Elite Collaborator
For what I know about this, Alfresco doesn't create indexes for hours, minutes and seconds.
This means that you can execute queries only on dates (comparing until the exact day)  even if you have to specify the suffix about the hour.

If you want you can enable the indexing process with the hour, please see:
http://blogs.alfresco.com/wp/developer/2011/02/01/whats-in-a-date/

Hope this helps Smiley Happy

kaynezhang
World-Class Innovator
World-Class Innovator
By changing datetime analyzer to DateTimeAnalyser and ) performing a full reindex,I think time will be indexed into lucene.
Have you tried to use time range query

@cm:created:["2014-03-26T14:19:42.000" TO "2014-03-26T14:19:48.000"]