Total number of results in search results (total count)

2019-05-06 Thread Verdan Mahmood
Hi,
So we are using Atlas's DSL search API and need to get the total count
along with paginated results.
And to solve this problem, at the moment we are making two queries, one is
to count all the entities and the second one to get the paginated result
using the limit parameters.

Is there a way to include the total count within the search response? Or
any other nicer solution?

Best,
*Verdan Mahmood*
(+31) 655 576 560


Fwd: Total number of results in search results (total count)

2019-05-08 Thread Verdan Mahmood
Repost: any help or suggestions?

Best,
*Verdan Mahmood*
(+31) 655 576 560


-- Forwarded message -
From: Verdan Mahmood 
Date: Mon, May 6, 2019 at 3:21 PM
Subject: Total number of results in search results (total count)
To: 


Hi,
So we are using Atlas's DSL search API and need to get the total count
along with paginated results.
And to solve this problem, at the moment we are making two queries, one is
to count all the entities and the second one to get the paginated result
using the limit parameters.

Is there a way to include the total count within the search response? Or
any other nicer solution?

Best,
*Verdan Mahmood*
(+31) 655 576 560


Re: Total number of results in search results (total count)

2019-05-08 Thread Apoorv Naik
The reasoning behind the exclusion of the total count is that the DSL query
is optimized to look at a smaller sub-graph (as small as possible), if the
total count has to be returned then we would have to start looking at a
bigger (potentially the complete graph) graph. As far as I can tell,
there's no better way of doing it as of now.

*Apoorv Naik*


On Wed, May 8, 2019 at 12:47 PM Verdan Mahmood 
wrote:

> Repost: any help or suggestions?
>
> Best,
> *Verdan Mahmood*
> (+31) 655 576 560
>
>
> -- Forwarded message -
> From: Verdan Mahmood 
> Date: Mon, May 6, 2019 at 3:21 PM
> Subject: Total number of results in search results (total count)
> To: 
>
>
> Hi,
> So we are using Atlas's DSL search API and need to get the total count
> along with paginated results.
> And to solve this problem, at the moment we are making two queries, one is
> to count all the entities and the second one to get the paginated result
> using the limit parameters.
>
> Is there a way to include the total count within the search response? Or
> any other nicer solution?
>
> Best,
> *Verdan Mahmood*
> (+31) 655 576 560
>