John
unread,May 7, 2012, 12:36:44 PM5/7/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ravendb
How will I pass parameters into this object so that I wanted to build
the "maps" string dynamically based on the paramters.
public class RavenDynamicIndex: AbstractIndexCreationTask
{
public RavenDynamicIndex()
{
}
public override IndexDefinition CreateIndexDefinition()
{
var maps = new HashSet<string>();
maps.Add(@"docs.Rolls.SelectMany(x => (x.RollIndexList),
(x, d) => new {DocumentType = d.Index.DocumentType})");
return new IndexDefinition
{
Name = "TestingDynamicIndex",
Maps = maps,
Reduce = "results.GroupBy(r => new {DocumentType =
r.DocumentType}).Select(g => new {DocumentType =
g.Key.DocumentType})"
};
}
}