Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8E0ADD32 for ; Wed, 8 Aug 2012 05:43:11 +0000 (UTC) Received: (qmail 20319 invoked by uid 500); 8 Aug 2012 05:43:11 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 20267 invoked by uid 500); 8 Aug 2012 05:43:11 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 20252 invoked by uid 99); 8 Aug 2012 05:43:10 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2012 05:43:10 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 3822714284D for ; Wed, 8 Aug 2012 05:43:10 +0000 (UTC) Date: Wed, 8 Aug 2012 05:43:09 +0000 (UTC) From: "Simon McNaughton (JIRA)" To: dev@jackrabbit.apache.org Message-ID: <323924800.3048.1344404590232.JavaMail.jiratomcat@issues-vm> In-Reply-To: <864110635.31645.1331101569697.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Comment Edited] (JCR-3252) Inflated QueryResultsImpl getTotalSize Count MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430882#comment-13430882 ] Simon McNaughton edited comment on JCR-3252 at 8/8/12 5:41 AM: --------------------------------------------------------------- Added Patch File. Adds a variable totalSize, which maintains a count of all valid entries. The getResults function is extended to continue checking the score nodes after maxResultSize nodes have been gathered. This is to continue scanning for nodes which the current session has access to. This will result in the return value for getTotalSize to be accurate even if there are nodes in the result set for which the current session has no permission to access. was (Author: uqsmcnau): Adds a variable totalSize, which maintains a count of all valid entries. The getResults function is extended to continue checking the score nodes after maxResultSize nodes have been gathered. This is to continue scanning for nodes which the current session has access to. This will result in the return value for getTotalSize to be accurate even if there are nodes in the result set for which the current session has no permission to access. > Inflated QueryResultsImpl getTotalSize Count > -------------------------------------------- > > Key: JCR-3252 > URL: https://issues.apache.org/jira/browse/JCR-3252 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core > Affects Versions: 2.1.6 > Reporter: Simon McNaughton > Priority: Minor > Attachments: QueryResultImp_3252.patch > > > The results of the method getTotalSize() in class org.apache.jackrabbit.core.query.lucene.QueryResultImpl appear to sometimes be inflated. > The method getTotalSize() returns the number of results of the query(numResults) minus the number of results that the accessManager has not allowed access to (invalid). The value of invalid appears to be determined during the method collectScoreNodes. > The issue is that 'invalid' doesn't appear to accurately reflect the total number of results of the orginal query that the user is not allowed access to, resulting in an incorrect value for getTotalSize(). > The cause of this appears to be in method collectScoreNodes because it will only check nodes to see if they are invalid while it is looking for the first 'maxResultSize' valid nodes. Any nodes after that limit are not checked for validity. This may result in a number of nodes that are invalid, but have not recorded as such. Then because the limit variable doesn't reflect the actual number of invalid results, the getTotalSize() value is inflated. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira