cancel
Showing results for 
Search instead for 
Did you mean: 

Does FTS Query support comparison operators?

jeevitha_balu
Champ in-the-making
Champ in-the-making
Hi,

I'm using FTS search query that has to fetch documents that contains a full text (or keyword) and also based on a specific date (either <, >, <= or >= a specific date). But with these comparison operators, SOLR search throws exception.  IS there any equivalent operators for FTS query to perform date comparisons?

This is my FTS query:

https://localhost:8080/alfresco/s/org/alfresco/xyz/faceted/search?query=(Keywords:'Test') AND cmis:creationDate <=  '2016-07-07' &count=10&language=fts-alfresco&skip=0&format=json

Exception:
"callstack" :
  [
       ""      ,"org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 07032268 SOLR side error: 07030010 line 1:96\nmismatched input '<EOF>' expecting TO  ([@29,96:96='<EOF>',<-1>,1:96])\n\t[ftsQuery, ftsDisjunction, ftsImplicitDisjunction, ftsExplicitConjunction, ftsPrefixed, ftsTest, ftsRange, ftsFieldGroupRange, recoverFromMismatchedToken]"
      ,"org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:472)"
      ,"org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:49)"
      ,"org.alfresco.repo.search.impl.solr.DbOrIndexSwitchingQueryLanguage.executeQuery(DbOrIndexSwitchingQueryLanguage.java:92)"
      ,"org.alfresco.repo.search.impl.solr.SolrSearchService.query(SolrSearchService.java:348)"
      ,"org.alfresco.repo.search.SearcherComponent.query(SearcherComponent.java:78)"
1 ACCEPTED ANSWER

jpotts
World-Class Innovator
World-Class Innovator
You can use a range query for this. For example, "cm:created:[MIN TO 2016-07-07]".

See http://docs.alfresco.com/4.0/concepts/rm-searchsyntax-ranges.html.

Jeff

View answer in original post

1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
You can use a range query for this. For example, "cm:created:[MIN TO 2016-07-07]".

See http://docs.alfresco.com/4.0/concepts/rm-searchsyntax-ranges.html.

Jeff