I\'ve been trying to find a solution for this requirement but I\'ve hit many dead ends.
I\'m using Cloudant as my data store of user documents. Each
Cloudant's search works at the granularity of returning a document. Your indexing function could index the categories in use across the item
s in the document and then your search would return the documents containing item
s with the category you mention. Your application code would then need to filter down to the item
s to return to the client.
Your index function would be something like (shamelessly cribbing from Wintamute):
if (!doc.items || doc.items.length === 0) return;
var item;
for (var i=0; i
The alternative is to break out the items into their own documents if you really want to be able to get just the items.
However, I'd second (and have up-voted) Wintamute's answer as I agree that the suggested view is the best solution in this specific case (find and display items by cat
).