jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: AW: AW: How do I get the total size of nodes/rows from a QueryResult
Date Wed, 26 Oct 2011 12:37:52 GMT
On 26.10.11 09:22, "Sascha.Theves@bosch-si.com"
<Sascha.Theves@bosch-si.com> wrote:

>> You can't be using limit & offset with Jackrabbit 1.x and Xpath...
>
>Hm but I really do that and it worked:
>
>   	((QueryImpl) query).setLimit(select.getLimit());
>   	((QueryImpl) query).setOffset(select.getOffset());
>   	QueryResultImpl queryResult = (QueryResultImpl)
>Executor.execute(query);
>	queryResult.getTotalSize();

Ah, you are right, forgot about them being on QueryImpl. But the behavior
should not have changed.

>Thanks for the tip and that makes 50% of my test cases to run without
>error but
>the other 50% do not work. I stripped the error down and found out that
>each query that uses a "contains" condition fails now.
>But the test fail not deterministic and I think that is because I add
>nodes with XML content (binary) in my test cases and immediately after
>adding the node I am searching for the content of the node. I think that
>the XMLTextExtractor runs in a paralles Thread and the computation is not
>finished when I try to query jackrabbit. I could now implement a delay in
>my tests but the best solution would be to wait until the
>XMLTextExtractor job is finished. Is there a possibility to do that or am
>I completely wrong with my suggestion?

Yes, extractors run in the background if they don't finish within a
certain timeframe (configurable as "extractorTimeout", see [0]). Maybe you
set this to a higher value for your tests, so you don't have to change
your test code to wait and retry.

[0] http://wiki.apache.org/jackrabbit/Search

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel





Mime
View raw message