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

Andrew Bullock
  • 36,616
  • 34
  • 155
  • 231

2 Answers2

1

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
  • 11,075
  • 19
  • 69
  • 111
1

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
  • 2,652
  • 7
  • 29
  • 45