AnsweredAssumed Answered

How to do a FTS-ALFRESCO date query with a custom datatime?

Question asked by spilby on Oct 6, 2016
Latest reply on Oct 7, 2016 by kaynezhang

Hi,

 

I'm using Alfresco 4.2.6 with SOLR.

 

I need to seach a custom property with a FTS-ALFRESCO query. This custom property is a datetime. This is how I define it on my xml model:

 

<namespaces>

<namespace uri="mydocument.model" prefix="doc" />

</namespaces>

 

<property name="doc:myDate" editVisible="true" createVisible="true" editable="true" inheritable="false" calculable="true">

                    <title>Data</title>

                    <type>d:datetime</type>

                    <mandatory>true</mandatory>

                    <index enabled="true">

                          <atomic>false</atomic>

                          <stored>false</stored>

                          <tokenised>false</tokenised>

                    </index>

                </property>

 

If I go to the node navigator of my share and search something like this:

 

(@cm\:created:["2016-01-07T00:00:00.000" TO "2016-10-05T23:59:59.000"])

 

the seach works and return me results. But if I try to use my custom property:

 

@doc\:myDate:["2016-01-07T00:00:00.000" TO "2016-10-05T23:59:59.000"]

 

returns me 0 results. I can see documents with my property correctly fulled:

 

doc:myDate

d:datetime

12 ene 2016 00:00:00 GMT+0100 (CET)

 

Exactly as the cm create date:

 

cm:created

d:datetime

12 ene 2016 15:57:17 GMT+0100 (CET)

 

And all my properties are indexed on SOLR, because I can find it with another query.

 

Where is the problem? Why that query don't return me results?

 

NOTE: I don't need to search with hours and minutes. Only with dates, if there are a response more simple.

 

Thanks! And best regards.

Outcomes