FreetextSearch Article Validity [MIN TO NOW] issue
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2012 09:37 AM
In FreetextSearch for article validity using '@cm\:from:[MIN TO NOW]' , but it is not checking the Time (hours, mins).
how can i check the date & time?
Thanks,
Siva.
how can i check the date & time?
Thanks,
Siva.
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2012 05:08 PM
Hello Siva,
Alfresco by default does not index the time fragment, so you can not perform a range query that respects hours / minutes out-of-the-box. With a simple configuration change, you can enable this (it is disabled by default for performance reasons as far as I know). Please have a look at Andy Hinds Blog.
Regards
Axel
Alfresco by default does not index the time fragment, so you can not perform a range query that respects hours / minutes out-of-the-box. With a simple configuration change, you can enable this (it is disabled by default for performance reasons as far as I know). Please have a look at Andy Hinds Blog.
Regards
Axel

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2012 07:21 PM
Hi Siva,
Just replace your code '@cm\:from:[MIN TO NOW]' with
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
String currentDateTime = dateFormat.format(new Date());
"@cm\\:from:[MIN TO" + currentDateTime + "]";
Basically you have to replace NOW with current time stamp in the required format as above.
NOW by default referes to the date and not the time stamp.
- Hemant
Just replace your code '@cm\:from:[MIN TO NOW]' with
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
String currentDateTime = dateFormat.format(new Date());
"@cm\\:from:[MIN TO" + currentDateTime + "]";
Basically you have to replace NOW with current time stamp in the required format as above.
NOW by default referes to the date and not the time stamp.
- Hemant
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2012 04:19 AM
"NOW" already is the current time stamp including the time, which is only used / effective when Lucene has been configured for millisecond resolution. There is no need to change NOW into anything else. Contrary to the previous comment, "TODAY" is the keyword for the current date without time fragment when Lucene has been configured for millisecond resolution.
The classes DateTokenFilter / DateTimeTokenFilter define how these special tokens are evaluated.
The classes DateTokenFilter / DateTimeTokenFilter define how these special tokens are evaluated.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2012 08:30 AM
tried with above approaches but no luck, please suggest any alternate way.
regards,
Siva.
regards,
Siva.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2012 09:20 AM
Hello Siva,
just to make sure: Did you modify / adapt the file dataTypeAnalyzers.properties and perform a full index rebuild?
Regards
Axel
just to make sure: Did you modify / adapt the file dataTypeAnalyzers.properties and perform a full index rebuild?
Regards
Axel

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2012 05:02 PM
Hi
What version of Alfresco are you using?
Andy
What version of Alfresco are you using?
Andy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2012 02:07 AM
Hi Axel,
i am using Alfresco 3.4.5 Enterprise version.
modified the dataTypeAnalyzers.properties as below
d_dictionary.datatype.d_date.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateAnalyser
d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser
Thanks,
Siva.
i am using Alfresco 3.4.5 Enterprise version.
modified the dataTypeAnalyzers.properties as below
d_dictionary.datatype.d_date.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateAnalyser
d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser
Thanks,
Siva.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2012 05:45 AM
Hi All,
Modified the dataTypeAnalyzers.properties as below
d_dictionary.datatype.d_date.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateAnalyser
d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser
And added below entry in alfresco-global.properties file
index.recovery.mode=FULL
Then performed full index rebuild. Now date & time is working fine for search.
Thanks,
Siva.
Modified the dataTypeAnalyzers.properties as below
d_dictionary.datatype.d_date.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateAnalyser
d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser
And added below entry in alfresco-global.properties file
index.recovery.mode=FULL
Then performed full index rebuild. Now date & time is working fine for search.
Thanks,
Siva.
