cancel
Showing results for 
Search instead for 
Did you mean: 

Searching with date/date time criteria

pankajt
Champ in-the-making
Champ in-the-making
Hi,

Can any body help me in how to enable search by date criteria using cmis apis in alfresco. I have tried suggestions mentioned in the thread below but none seems to work:

https://forums.alfresco.com/en/viewtopic.php?f=45&t=42259
https://issues.alfresco.com/jira/browse/ALF-5378

Thanks,
Pankaj
7 REPLIES 7

jpotts
World-Class Innovator
World-Class Innovator
Please specify the exact problem you are having and provide any error messages or differences in expected results.

Jeff

pankajt
Champ in-the-making
Champ in-the-making
I am using alfresco's Node Browser to test the results obtained for different cmis based queries.

The query
select cmis:name from cmis:document 
executes successfully and returns me results as well. But when I try to run a query for searching documents by datetime, it returns me 0 records all the time

The query I am executing is as below:
select cmis:objectId, cmis:name from cmis:document where cmis:lastModificationDate<TIMESTAMP'2010-09-23T16:56:49.925+02:00'

I have tried using <, >, <=, >= but none of them is returning me any records.  The query is compiling successfully as it does not gives me any error as well.

In one of the threads, a search configuration was suggested https://issues.alfresco.com/jira/browse/ALF-5378. I have tried this as well with no success.

I am using Alfresco Community Edition 4.0.d. I have done full re-indexing as well after enabling the dateTimeAnalyzer in the lucene search configuration.

Thanks,
Pankaj

jpotts
World-Class Innovator
World-Class Innovator
Pankaj,

I am using 4.0.d with out-of-the-box dataTypeAnalyzers.properties and Lucene and I cannot reproduce the problem you are seeing. Are you using Lucene or Solr for search?

Jeff

pankajt
Champ in-the-making
Champ in-the-making
I have not modified any configuration settings except for the change suggested here https://issues.alfresco.com/jira/browse/ALF-5378, in effect I am using default Alfresco settings.

Probably a dumb question, how do I configure lucene search to answer my cmis:strict queries

jpotts
World-Class Innovator
World-Class Innovator
Okay, I have recreated this using the alfresco-4.0.d binary installer. When running with Lucene your query will return results. When running with Solr your query returns no results.

There are other forum posts which talk about changing dataTypeAnalyzers.properties to set
d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser

This has no effect on this problem.

If you want to switch back to Lucene, all you have to do is:
  • Edit $TOMCAT_HOME/shared/classes/alfresco-global.properties

  • Set index.subsystem.name=lucene

  • Set index.recovery.mode=FULL

  • Save and restart
Note that this requires a full Lucene index which may take a lot of time depending on the size of the repo.

Also, set your index.recovery.mode back to AUTO after the server comes up.

I have created a Jira for this issue even though it sounds very similar to some of the problems people have been having with CMIS and date range queries.

pankajt
Champ in-the-making
Champ in-the-making
By default Alfresco comes with solr search which is having the problem. I have made the changes as suggested and the date/datetime search is working fine with lucene search.

This information is helpful.

Thanks,
Pankaj

andy
Champ on-the-rise
Champ on-the-rise
Hi

This is known issue with opencmis implementation in V4.0.
See https://issues.alfresco.com/jira/browse/ALF-12944

The work around is to use the old cmis impl using the urls as in V3.4.

Andy