jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ana Osman <ana.os...@gmail.com>
Subject Re: JCR query fails when filtering through more than 25 results
Date Thu, 15 Apr 2010 11:04:59 GMT
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 <aklimets@day.com>

> On Wed, Apr 14, 2010 at 15:14, Ana Osman <ana.osman@gmail.com> 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
>

Mime
View raw message