Permalink
Browse files

Adding LastModified field to Raven/DocumentsByEntityName index

  • Loading branch information...
1 parent 9144575 commit 6b2a8ed1b029af2989c665f641978926bf239c8b @ayende ayende committed Jun 26, 2011
@@ -26,9 +26,17 @@ public override IndexDefinition CreateIndexDefinition()
Map = @"from doc in docs
let Tag = doc[""@metadata""][""Raven-Entity-Name""]
where Tag != null
-select new { Tag };",
- Indexes = {{"Tag", FieldIndexing.NotAnalyzed}},
- Stores = {{"Tag", FieldStorage.No}}
+select new { Tag, LastModified = doc[""@metadata""][""Last-Modified""] };",
+ Indexes =
+ {
+ {"Tag", FieldIndexing.NotAnalyzed},
+ {"LastModified", FieldIndexing.NotAnalyzed}
+ },
+ Stores =
+ {
+ {"Tag", FieldStorage.No},
+ {"LastModified", FieldStorage.No}
+ }
};
}
}
@@ -19,9 +19,17 @@ public void SilverlightWasRequested(IResourceStore resourceStore)
@"from doc in docs
let Tag = doc[""@metadata""][""Raven-Entity-Name""]
where Tag != null
-select new { Tag };",
- Indexes = { { "Tag", FieldIndexing.NotAnalyzed } },
- Stores = { { "Tag", FieldStorage.No } }
+select new { Tag, LastModified = doc[""@metadata""][""Last-Modified""] };",
+ Indexes =
+ {
+ {"Tag", FieldIndexing.NotAnalyzed},
+ {"LastModified", FieldIndexing.NotAnalyzed}
+ },
+ Stores =
+ {
+ {"Tag", FieldStorage.No},
+ {"LastModified", FieldStorage.No}
+ }
});
}

0 comments on commit 6b2a8ed

Please sign in to comment.