Ok Oren, here is my code,
============================================================
public class GetTotalAssetStorageSize : AbstractIndexCreationTask<Asset,GetTotalAssetStorageSize.Result>
{
/// <summary>
/// The class that maps the fields in Assets document for doing a full text search.
/// </summary>
public class Result
{
/// <summary>
/// Gets or sets the FileSize.
/// </summary>
public int FileSize { get; set; }
}
/// <summary>
/// Initializes a new instance of the GetTotalAssetStorageSize class.
/// </summary>
public GetTotalAssetStorageSize()
{
Map = assets => from asset in assets
select new
{
Total = asset.FileSize,
};
Reduce = results => from result in results
group result by 1 into g
select new
{
Total = g.Sum(x=>x.FileSize)
};
}
}
============================================================
for fetching the results, I use the following code,
var results = this.Session.Query<GetTotalAssetStorageSize.Result,GetTotalAssetStorageSize>()
.ToArray();
Do I miss something? Please help..............
Regards,
Avin