In Cloudant is it possible to do something like a reduce on a set of results from a search index (as opposed to a view)?
In my case, I'd like to find all documents that have a title value that includes 'foo', then for each of these sum the total number of views, based on each document's viewCount value.
You can't
reduce
but you can use faceting to get counts.Example query
?q=*:*&counts=["type"]
Example response
https://docs.cloudant.com/search.html#faceting