Vitor Eduardo
Vitor Eduardo

Reputation: 1

Two counts in just one SOLR query

My question is: How could I realize two counts in just one SOLR query? I have tried something like this:

q=query&field:[* TO *],-field:[* TO *]&start=0&rows=0&facet=true&facet.missing=true

i.e. I am trying to count null records and not null records for the same field.

No error reported but no result retrieved.

Upvotes: 0

Views: 57

Answers (1)

arun
arun

Reputation: 11023

This should give you both counts:

q=query&facet=true&facet.query=field:[* TO *]&facet.query=-field:[* TO *]&rows=0

Upvotes: 2

Related Questions