From dev-return-28011-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Apr 15 11:05:30 2010
Return-Path:
Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org
Received: (qmail 78273 invoked from network); 15 Apr 2010 11:05:30 -0000
Received: from unknown (HELO mail.apache.org) (140.211.11.3)
by 140.211.11.9 with SMTP; 15 Apr 2010 11:05:30 -0000
Received: (qmail 98693 invoked by uid 500); 15 Apr 2010 11:05:30 -0000
Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org
Received: (qmail 98288 invoked by uid 500); 15 Apr 2010 11:05:27 -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 98281 invoked by uid 99); 15 Apr 2010 11:05:26 -0000
Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Apr 2010 11:05:26 +0000
X-ASF-Spam-Status: No, hits=2.2 required=10.0
tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: apache.org
Received-SPF: pass (athena.apache.org: domain of ana.osman@gmail.com designates 209.85.218.217 as permitted sender)
Received: from [209.85.218.217] (HELO mail-bw0-f217.google.com) (209.85.218.217)
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Apr 2010 11:05:20 +0000
Received: by bwz9 with SMTP id 9so1138824bwz.9
for ; Thu, 15 Apr 2010 04:04:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:received:in-reply-to:references
:date:received:message-id:subject:from:to:content-type;
bh=ZDvDHPM2dZLY0Sd79LTAROb88qJa+01VJtnYUiRetj8=;
b=aRpJ405NLZGg1SazN9/CUEzWt8DlCANaSAHCPCSr5GJyXKPY1LKz+Ky+DR/kuiHh31
UtvvR8yMlW8TV7d6Zi/Qcr5IiNFBLozjU/BdHslvWKKKrn9hXewJBf/9uytt9uneHAq2
OOXdLcwMgMHa38/njnifdGbJU9RFTpiYkUDpc=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
b=bvRi/saT1bqeahO2xJ6NCS2uicw+pbA1e9HYQ9+6WCEE/wgpryWjjyeXnZSwp+gZpL
oA0/UFKoCtWivWsl+5Aq9D9zquAIqeXl17naBbePfTIZRZq8MIi5/NsLbhQTgPBHr6UO
20BT47RwBirbXyxAXQ2UvS1Nc592ehNwzTLMc=
MIME-Version: 1.0
Received: by 10.103.24.2 with HTTP; Thu, 15 Apr 2010 04:04:59 -0700 (PDT)
In-Reply-To:
References: <4BC49B59.1010409@gmail.com>
<4bc5bfc0.0f345e0a.19d7.54f2@mx.google.com>
Date: Thu, 15 Apr 2010 14:04:59 +0300
Received: by 10.103.84.21 with SMTP id m21mr5079037mul.106.1271329499092; Thu,
15 Apr 2010 04:04:59 -0700 (PDT)
Message-ID:
Subject: Re: JCR query fails when filtering through more than 25 results
From: Ana Osman
To: dev@jackrabbit.apache.org
Content-Type: multipart/alternative; boundary=0016e65b5b0a2f98150484447708
--0016e65b5b0a2f98150484447708
Content-Type: text/plain; charset=ISO-8859-1
I can't make it a number. In this particular case, it is a number, but there
are exceptions when this field can also contain strings. So, I just have to
leave it as a string, and in this particular care, to treat it as a number.
What I have discovered in the meantime is that there might not be a problem
with the number of results, but with the way jackrabbit queries the db.
So, I have to find all the nodes from this path:
/wsDocumentList/Board-of-Directors/% filtered by the year field (which can
be from 2000 to 2010). When trying to retrieve the nodes from 2003, 2006 and
2009, the error appears. We've taken into account that there might be
corrupted nodes, but it seems it's not the case. These are the tests we've
run:
SELECT * FROM nt:base WHERE (jcr:primaryType = 'mgnl:contentNode' OR
jcr:primaryType = 'mgnl:content') AND name <> 'description_files' AND
year='2003' AND jcr:path LIKE '/wsDocumentList/Board-of-Directors/%' ORDER
BY name asc
-> this returns the ERROR
SELECT * FROM nt:base WHERE (jcr:primaryType = 'mgnl:contentNode' OR
jcr:primaryType = 'mgnl:content') AND name <> 'description_files' AND
year='2003' AND (type='doc' OR type='pdf' OR type='jpg' OR type='ppt') AND
jcr:path LIKE '/wsDocumentList/Board-of-Directors/%' ORDER BY name asc
-> this returns the corresponding nodes. In the specified path
(/wsDocumentList/Board-of-Directors/%) there are only nodes with the field
"type" equal to: doc, ppt, pdf and jpg, so this query returns all the nodes
from that path with year = 2003.
The only difference between the two queries is filter for the type
field: (type='doc' OR type='pdf' OR type='jpg' OR type='ppt') , although
both these queries should return the same result.
Why could this be happening?
Thank you very much for helping,
Ana Osman
2010/4/14 Alexander Klimetschek
> On Wed, Apr 14, 2010 at 15:14, Ana Osman wrote:
> > The year field's type is string, so when trying year <= 2003, there are 0
> > results (but no error).
>
> Then you should make it a number.
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
--0016e65b5b0a2f98150484447708
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I can't make it a number. In this particular case, it is a number, but =
there are exceptions when this field can also contain strings. So, I just h=
ave to leave it as a string, and in this particular care, to treat it as a =
number.

What I have discovered in the meantime is that there might n=
ot be a problem with the number of results, but with the way jackrabbit que=
ries the db.

So, I have to find all the nodes from=
this path:=A0/wsDocumentList/Board-of-Directors/%=A0=A0filtered by the year field (which can be from 2000 to 2010). When t=
rying to retrieve the nodes from 2003, 2006 and 2009, the error appears. We=
've taken into account that there might be corrupted nodes, but it seem=
s it's not the case. These are the tests we've run:=
div>

SELECT * FROM nt:base WHERE (jcr:primaryType=
=3D
'mgnl:contentNode' OR jcr:primaryType =3D 'mgnl:content') A=
ND name <>
'description_files' AND year=3D'2003' AND jcr:path LIKE =
9;/wsDocumentList/Board-of-Directors/%' ORDER
BY name asc=A0

-> this returns the ERROR=
span>

SELECT * FROM nt:base WHERE (jcr:primaryType=
=3D
'mgnl:contentNode' OR jcr:primaryType =3D 'mgnl:content') A=
ND name <>
'description_files' AND year=3D'2003' AND (type=3D'doc&=
#39; OR type=3D'pdf' OR type=3D'jpg'
OR type=3D'ppt') AND jcr:path LIKE '/wsDocumentList/Board-of-Di=
rectors/%' ORDER
BY name asc

-> this returns the corresponding nodes. =
In the specified path (/wsDocumentList/Board-of-Directors/%) there are only=
nodes with the field "type" equal to:=A0doc, ppt, pdf and jpg, s=
o this query returns all the nodes from that path with year =3D 2003.

<=
span class=3D"Apple-style-span" style=3D"font-family: Calibri, sans-serif; =
font-size: 15px; ">The only difference between the two queries =
is filter for the type field:=A0=A0(type=3D'doc' OR type=3D'pdf=
' OR type=3D'jpg' OR type=3D'ppt') , although both thes=
e queries should return the same result.