I’ve just released FluentNHibernate.Search 0.2 Beta which is available on CodePlex and support the following new features.
Field Mapping without specifying "Name"
Actually we needed to specify Field name using .Field(“FieldName”) :
1: public class BookSearchMap : DocumentMap<Book>
2: {
3: public BookSearchMap()
4: {
5: Id(p => p.BookId).Field("BookId").Bridge().Guid();
6: }
7: }
Now if we don’t specify this, the field name will be automaticaly taken from the mapped property name.
1: public class BookSearchMap : DocumentMap<Book>
2: {
3: public BookSearchMap()
4: {
5: Id(p => p.BookId).Bridge().Guid();
6: }
7: }
Id Mapping without specifiying "Field"
Actually to we needed to specify Field name using .Name(“FieldName”) for Field mapping, now we can forget this, it will be taken directly from the mapping property name.
However we can overrides that name using .Name(“FieldName”) method.
1: public class BookSearchMap : DocumentMap<Book>
2: {
3: public BookSearchMap()
4: {
5: Id(p => p.BookId).Bridge().Guid();
6: Name("Book");
7:
8: Map(x => x.Title)
9: .Store().Yes()
10: .Index().Tokenized();
11: Map(x => x.Description)
12: .Store().Yes()
13: .Index().Tokenized();
14: }
15: }
Embedded Mapping
FluentNHibernate.Search now support embedded mapping using the Embedded method in DocumentMap.
1: public class AuthorSearchMap : DocumentMap<Author>
2: {
3: public AuthorSearchMap()
4: {
5: Id(p => p.AuthorId)Bridge().Guid();
6: Name("Author");
7:
8: Map(x => x.Name)
9: .Store().Yes()
10: .Index().Tokenized();
11:
12: Embedded(x => x.Books).AsCollection();
13: }
14: }
Views(1579)

