To get these two numbers you would have to do an aggregate query separately from the retrieve.
If you are working in Java anyway this is pretty easy. The core api also has the retrieve xpath aggregate function available.
You would simply have to write one line of code extra and re-use the xpath that you already have, that way you can't make any translation mistakes either.
Just use the code below:
long countResult = Core.retrieveXPathQueryAggregate( "COUNT(" + myXPath + ")" );
The platform will translate that to an SELECT COUNT(*) OQL/SQL query and just give you the qty back
Have you tried searching using a List View object - you are able to define multiple attributes from the main or associated objects to search on, in a single search field
I can't figure how you could accomplish this without running 2 queries, which can still be done with XPath. For the aggregate query, wrap your Xpath query with the count()
function. For the 100 record limit, use the additional parameters offset and limit parameters to Core.retrieveXPathQuery
.