1

I want to find documents on an Alfresco 5.0 system over CMIS by its content (fulltext). Following queries don't return anything:

SELECT * FROM cmis:document WHERE CONTAINS('test')

SELECT * FROM cmis:document WHERE CONTAINS(TEXT:'test')

SELECT * FROM cmis:document WHERE CONTAINS(ALL:'test')

I tried the queries from the CMIS Workbench as well as programmatically from an Java application. Repository info tells me that queries are "BOTHCOMBINED" and documents are "Queryable" and "Full text indexed". Searching by metadata (e.g. "cmis:name") works fine as well.

enigma969
  • 397
  • 6
  • 21
  • 2
    Have you confirmed that searching from within the Alfresco Share UI works as expected? Maybe your Solr index has a problem. – Jeff Potts Aug 12 '16 at 14:09
  • Searching from within the Alfresco Share UI doesn't work either... Where can I check whether Solr is indexing correctly? – enigma969 Aug 12 '16 at 14:40

3 Answers3

3

Check your Solr index, maybe it has a problem. Assuming that is okay, on my machine, running against Alfresco 5.0.d installed with the binary installer and executing queries from within Chemistry Workbench, the following happens:

Returns the expected results:

SELECT * FROM cmis:document WHERE CONTAINS('test')

Returns an error:

SELECT * FROM cmis:document WHERE CONTAINS(TEXT:'test')
SELECT * FROM cmis:document WHERE CONTAINS(ALL:'test')

Returns the expected results (fixed the apostrophe):

SELECT * FROM cmis:document WHERE CONTAINS('TEXT:test')

Also, make sure you are using the proper CMIS service URL, which for the browser binding and CMIS 1.1 on Alfresco 5.x is:

http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser
Jeff Potts
  • 10,468
  • 17
  • 40
0

I would suggest to use wildcards:

SELECT * FROM cmis:document WHERE CONTAINS('*test*')

Are you sure that in your repository you have documents which contains test word? Please note that text is tokenised using space character. Have you tried your queries in Node Browser of Admin Tools screen?

streetturtle
  • 5,472
  • 2
  • 25
  • 43
  • This query doesn't work either. Yes I am pretty sure that there are documents in the repository that contain the word as its content. E.g. this document https://www.dropbox.com/s/u0zs2fqeaa8gckj/demo-document.pdf?dl=0 should be findable not only by its name but also by its content which is "Stackoverflow" in this example... – enigma969 Aug 12 '16 at 11:32
0

The problem was due to an erroneous Solr Index as Jeff Pots mentioned. Thanks

enigma969
  • 397
  • 6
  • 21