-
Type:
Hot Fix Request
-
Status: Closed
-
Resolution: Won't Fix
-
Affects Version/s: 5.0.0.3
-
Fix Version/s: None
-
Component/s: Search and Indexing (non-UI)
-
Labels:None
-
Environment:Alfresco 5.0.0.5, 5.0.1, 5.0.2 - solr4
opencmis-workbench-0.12.0-full
-
Bug Priority:
-
ACT Numbers:
00439664
Using disjunction "OR" in CMIS query returns wrong number of results when SOLR 4 is used.
Environment:
Alfresco 5.0.0.5, 5.0.1, 5.0.2 (checked with both solr1 and solr4).
For CMIS query 'opencmis-workbench-0.12.0-full' has been used.
Steps to reproduce:
1- In Alfresco Share invite a user to a site (e.g. "user1" with "Consumer" role)
2 - In document library of a site create two items of content: "test1.txt" and "test2.txt"
3- In workbench the following cmis query returns two results for both "user1" and "admin":
SELECT * FROM cmis:document WHERE cmis:name like '%test1%' or cmis:name like '%test2%' order by cmis:name
4- Disable inheritance for both "test1.txt" and "test2.txt" and add "user1" to have permission on "test1.txt" (e.g. "Site Consumer")
5- Run the same cmis query again with admin user:
SELECT * FROM cmis:document WHERE cmis:name like '%test1%' or cmis:name like '%test2%' order by cmis:name
Expected behaviour:
The query returns 2 records: one record for test1.txt and one for test2.txt
Observed behaviour:
The query returns 4 records: two records for test1.txt and two records for test2.txt. (duplicates the result)
6- Run this query with "user1" user:
SELECT * FROM cmis:document WHERE cmis:name like '%test1%' or cmis:name like '%test2%' order by cmis:name
Expected behaviour:
The query returns 1 records: test1.txt that this user has permission on that.
Observed behaviour:
It displays "runtime: Unauthorized" error message.
Analysis to date:
- If "OR" disjunction is removed in the query, it displays correct number of results:
SELECT * FROM cmis:document WHERE cmis:name like '%test1%'
This returns one result with admin user and one result with user "user1"
SELECT * FROM cmis:document WHERE cmis:name like '%test2%'
This returns one result with admin user and no result with user "user1"
- Reverting the permission to the default value doesn't fix the issue. Query still displays 4 records for admin.
- This issue is NOT reproducible in Solr 1.
- Log messages after enabling the following debugs:
log4j.logger.org.alfresco.solr.query.AbstractQParser=DEBUG
log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient=debug
DEBUG [org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient] [http-apr-8080-exec-3] Sent :/solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=100&df=TEXT&start=0&locale=en_AU&alternativeDic=DEFAULT_DICTIONARY&cmisVersion=CMIS_1_0&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON
DEBUG [org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient] [http-apr-8080-exec-3] with:
DEBUG [org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient] [http-apr-8080-exec-3] Got: 4 in 892 ms