RavenDB allows you to define more than one Map
function for static indexes. In this case such indexes are called Multi map indexes. When using a Multi map index, we are looking to take information from different documents. A single map index has only one Map
function, while a Multi map index has more than one Map
function. A Multi map index will get its data from multiple sources. It may have no or only one Reduce
function, and no or only one TranformResults
function.
If the index has a Reduce
function, then the multi map
(s) function(s) output is sent to the Reduce
function. The only requirement that we have is that the output of all of the Map
functions should be identical (and obviously, matches the output of the Reduce
function). Then we can just treat this information as normal Map/Reduce index, which means that you can use all usual index features of RavenDB.
To create a multi map index
class, we have to inherit from the AbstractMultiMapIndexCreationTask
class...