Andrew Bullock
Andrew Bullock

Reputation: 37378

NHibernate Search without attributes

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

Upvotes: 2

Views: 713

Answers (2)

Yoann. B
Yoann. B

Reputation: 11143

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/

Upvotes: 1

Scott Cowan
Scott Cowan

Reputation: 2662

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.

Upvotes: 1

Related Questions