views:

153

answers:

2

Is there any NHibernate Search library which doesn't require attributes on your entity properties?

I'd like to keep my entities as clean POCOs, so perhaps there is a fluent interface?

If not, perhaps I'll write one!

Thanks

+1  A: 

Ayende has said that he'll add xml mapping to NHibernate Search if someone wants to do it for him. So I wouldn't hold your breath.

I wonder if you can do programatic mapping, I'll check on that.

Scott Cowan
+1  A: 

Woow old question, but maybe it should help.

I've just started a Fluent NHibernate.Search mapping interface similar to FluentNHibarnate, which allow you to map your entities without attributes.

public class BookSearchMap : DocumentMap<Book>
{
    public BookSearchMap()
    {
        Id(p => p.BookId).Field("BookId").Bridge().Guid();
        Name("Book");
        Boost(500);
        Analyzer<StandardAnalyzer>();

        Map(x => x.Title)
            .Analyzer<StandardAnalyzer>()
            .Boost(500);

        Map(x => x.Description)
            .Boost(500)
            .Name("Description")
            .Store().Yes()
            .Index().Tokenized();
    }
}

You should take a look on the project site hosted on codeplex.

http://fnhsearch.codeplex.com/

Yoann. B
nice, saves me writing it. I shall take a look!
Andrew Bullock
@Andrew : You're welcome, if you are interrested in this project, i'm looking for help to develop some features, take a look on the project homepage and join if you want ! :)
Yoann. B