[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 |
|
Status: | Closed |
Project: | Service Packs and Hot Fixes |
Component/s: | Search and Indexing (non-UI) |
Affects Version/s: | 5.0.0.5 |
Fix Version/s: | 5.0.2 |
Type: | Service Pack Request | ||
Reporter: | Rosa Abbaspour [X] (Inactive) | Assignee: | Closed Bugs (Inactive) |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | 0 minutes | ||
Time Spent: | 1 day, 6 hours | ||
Original Estimate: | Not Specified | ||
Environment: |
Alfresco 5.0.0.5, 5.0.1, 5.0.2 - solr4 |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() |
||||||||||||||||||||||||||||||||||||
Issue Links: |
|
||||||||||||||||||||||||||||||||||||
Bug Priority: |
|
||||||||||||||||||||||||||||||||||||
ACT Numbers: | 00353945, 00379051, 00439664, 00452090 |
||||||||||||||||||||||||||||||||||||
Build Location: | https://releases.alfresco.com/Enterprise-5.0/5.0.2/build-00086/ALL |
Description |
Using disjunction "OR" in CMIS query returns wrong number of results when SOLR 4 is used. Environment: 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: Expected behaviour: Observed behaviour: 6- Run this query with "user1" user: Expected behaviour: Observed behaviour: Analysis to date:
SELECT * FROM cmis:document WHERE cmis:name like '%test2%'
Logging 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: Unknown macro: {"queryConsistency"}
DEBUG [org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient] [http-apr-8080-exec-3] Got: 4 in 892 ms |
Comments |
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. |