There is an undocumented "null" expression which will return the count:

null(expr())

It would of course be good to document this expression.

Joel Bernstein
http://joelsolr.blogspot.com/


On Tue, Sep 20, 2022 at 10:08 AM Sergio García Maroto <[email protected]>
wrote:

> Hi,
>
> I am trying to find a way to get the number of results after running a few
> nested streaming expressions.
> Similar to the numFound  parameter on select numFound":50743918.
>
> I found stats something similar. Althought this only applies to stream
> expressions with queries embedded.
> stats(articles, q="CommentTextS:fintech",count(*))
>
> Let's say I have an stream expression as bellow. Do I need to retrieve the
> full list of PersonIDSDV to count it?
> sort(
> rollup(
> merge(
>   search(articles, q="CommentTextS:fintech",  qt="/export",
> fl="PersonIDSDV", sort="PersonIDSDV asc"),
>   merge(
>  search(comments, q="CommentTextS:"fintech"", qt="/export",
>  fl="PersonIDSDV", sort="PersonIDSDV asc"),
>  search(topics, q="CommnetTextS:fintech", qt="/export", fl="PersonIDSDV",
> sort="PersonIDSDV asc"),
>   on="PersonIDSDV asc"),
> on="PersonIDSDV asc"),
> over="PersonIDSDV",
> count(*)
> ),
> by="count(*) desc"
> )
>
> Thanks for the support
> Sergio Maroto
>

Reply via email to