Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 75068 invoked from network); 6 Aug 2007 12:14:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Aug 2007 12:14:34 -0000 Received: (qmail 33859 invoked by uid 500); 6 Aug 2007 12:14:20 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 33832 invoked by uid 500); 6 Aug 2007 12:14:20 -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 33806 invoked by uid 99); 6 Aug 2007 12:14:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 05:14:19 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 12:14:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DB42471420A for ; Mon, 6 Aug 2007 05:13:59 -0700 (PDT) Message-ID: <9091394.1186402439893.JavaMail.jira@brutus> Date: Mon, 6 Aug 2007 05:13:59 -0700 (PDT) From: "Ard Schrijvers (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (JCR-1051) MatchAllScorer calculateDocFilter() bug MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org MatchAllScorer calculateDocFilter() bug --------------------------------------- Key: JCR-1051 URL: https://issues.apache.org/jira/browse/JCR-1051 Project: Jackrabbit Issue Type: Bug Components: indexing Affects Versions: 1.3 Reporter: Ard Schrijvers Fix For: 1.4 In MatchAllScorer.calculateDocFilter(), When you have just two nodes, with different properties, like "myprop" and "myprop2", and you have an xpath String xpath = "//*[@myprop], you get both nodes back (to be precise, you'll get every node that has a property that startswith "myprop") You can reproduce it by changing the SimpleQueryTest.testIsNotNull() a little: Change bar.setProperty("text", "the quick brown fox jumps over the lazy dog."); to bar.setProperty("mytextwhichstartswithmytext", "the quick brown fox jumps over the lazy dog."); Now the test with xpath = "//*[@jcr:primaryType='nt:unstructured' and @mytext]"; fails because 2 results. I did test for the trunk and tag 1.3.1 and both have the same problem. I have attached MatchAllScorer.java.patch in this mail, or should I create a JIRA issue for this? Furthermore I would like to discuss a different implementation for the MatchAllScorer, because IMHO the current calculateDocFilter() becomes slow pretty fast (see bottom email the code part i am referring to: if you have 100.000 docs with "mytext" property, and you query [@mytext] the loop below is executed at least 100.000 times). I think it might be out of scope for the user-list, or is the user-list the place to discuss something like this? ----------------------------------------------------------------------- TermEnum terms = reader.terms(new Term(FieldNames.PROPERTIES, field)); try { TermDocs docs = reader.termDocs(); try { while (terms.term() != null && terms.term().field() == FieldNames.PROPERTIES && terms.term().text().startsWith(field)) { docs.seek(terms); while (docs.next()) { docFilter.set(docs.doc()); } terms.next(); } } finally { docs.close(); } } finally { terms.close(); } ----------------------------------------------------------------------- -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.