[MNT-13767] Using disjunction "OR" in CMIS query returns wrong number of results when SOLR 4 is used Created: 01-Apr-15 Updated: 04-Nov-15 Resolved: 29-May-15
|Project:||Service Packs and Hot Fixes|
|Component/s:||Search and Indexing (non-UI)|
|Type:||Service Pack Request|
|Reporter:||Rosa Abbaspour [X] (Inactive)||Assignee:||Closed Bugs|
|Remaining Estimate:||0 minutes|
|Time Spent:||1 day, 6 hours|
|Original Estimate:||Not Specified|
Alfresco 220.127.116.11, 5.0.1, 5.0.2 - solr4
|Attachments:||01_cmisadminlogin.jpg 02_AminQueryBeforePermissionChange.jpg 03_ChangePermission_text1.jpg 04_ChangePermission_text2.jpg 05_AminQueryAfterPermissionChange.jpg 06_user1QueryAfterPermissionChange.jpg|
00353945, 00379051, 00439664, 00452090
Using disjunction "OR" in CMIS query returns wrong number of results when SOLR 4 is used.
Steps to reproduce:
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":
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:
6- Run this query with "user1" user:
Analysis to date:
SELECT * FROM cmis:document WHERE cmis:name like '%test2%'
|Comment by Rosa Abbaspour [X] (Inactive) [ 07-Apr-15 ]|
I've checked this in versions 5.0.1 and 5.0.2 and updated the steps in the jira accordingly:
I'm using this URL to bind from CMIS Workbench http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom
SELECT * FROM cmis:document WHERE cmis:name like '%test1%' => one result with admin user and one result with user "user1"
The issue happens after disabling permission inheritance only if we use "OR" in the query.
|Comment by Pavel Yurkevich (Inactive) [ 13-Apr-15 ]|
This issue occurs because solr index is not updated properly. Before re-indexing updated metadata we should remove existing entry from index for updated node (or specify overwrite flag=true for AddUpdateCommand).
Currently we use tenant, aclId, dbid as unique key to find/remove/create document in solr index. After changing permissions for node the new aclId is assigned to this node. As a result old record is not removed from index and is not overwritten because there is no corresponding document in index for this key tenant, newAclId, dbid.
I suggest remove existing document by using only node DBID. I guess it should be unique. Please review r101738
|Comment by Alan Davis [ 15-Jul-15 ]|
Please note to fix this issue requires both the fix AND a re-index, because Solr 4 index may already contains the wrong documents. If a reindex is not done the impact will be that the issue is still seen – search queries may return wrong number of results.
|Comment by Andrew Hind [X] (Inactive) [ 27-Jul-15 ]|
Using the FIX action should correct any duplicate nodes.