I am playing around with event sourcing using RavenDB.
I am storing all my events as documents in RavenDB then have a map/reduce index to generate the aggregates (similar to what is described here http://ayende.com/blog/4530/raven-event-sourcing).
However now I would like to index the aggregates that were the output of the map/reduce so I can query meaningful data in the database (e.g. finding accounts with negative balance). Unfortunately I can only seem to create indexes on documents which would make this whole approach unusable.
Is it possible to create an index on an index in RavenDB? Is there an alternative way to achieve the same result? Or am I better off to not have my aggregates as a map/reduce and just put them in as simple documents?