When using com.day.cq.search.QueryBuilder, is there any difference between p.limit = 0 and p.limit = -1?
Seems to me that both behave the same, but in I could only find p.limit = -1 stated in the docs.
Solved! Go to Solution.
Views
Replies
Total Likes
LinearGradient wrote...
Thanks for the reply Ove. But what's the difference between "unlimited with intention" "the default unlimited".
And are they documented anywhere?
Thanks.
Hi,
it is more of a way of thinking when you create query languages. There might be limitations set by a connector or something that then honors the default limit notation (0) and if you want to intentionally get everything, regardless of any limitations, then you use the unlimited flag (-1).
I have myself done quite a lot of this kind of notations, so it is a common pattern to use -1 as "unlimited", 0 as "systems choise" and 0< for user selected limitations.
Havn't actually found any documentation on this so don't take my words as the absolute truth. Just falling back on "previous knowledge" ;)
/O
Views
Replies
Total Likes
The -1 is used for "unlimited with intention" and the 0 is "the default unlimited". If you use p.limit=<any positive integer>, that is the limit of the anwswers you get.
That is why only -1 is documented.
/Ove
Views
Replies
Total Likes
Thanks for the reply Ove. But what's the difference between "unlimited with intention" "the default unlimited".
And are they documented anywhere?
Thanks.
Views
Replies
Total Likes
LinearGradient wrote...
Thanks for the reply Ove. But what's the difference between "unlimited with intention" "the default unlimited".
And are they documented anywhere?
Thanks.
Hi,
it is more of a way of thinking when you create query languages. There might be limitations set by a connector or something that then honors the default limit notation (0) and if you want to intentionally get everything, regardless of any limitations, then you use the unlimited flag (-1).
I have myself done quite a lot of this kind of notations, so it is a common pattern to use -1 as "unlimited", 0 as "systems choise" and 0< for user selected limitations.
Havn't actually found any documentation on this so don't take my words as the absolute truth. Just falling back on "previous knowledge" ;)
/O
Views
Replies
Total Likes