0

I downloaded source code from http://nhcontrib.svn.sourceforge.net/viewvc/nhcontrib/trunk/src/ changed the reference to 3.2 version of NHibernate. When I compiled I got following error/warning messages

  • Error 1 'NHibernate.Search.Impl.FullTextSessionImpl' does not implement interface member 'NHibernate.ISession.QueryOver(string, System.Linq.Expressions.Expression>)'
  • Error 2 'NHibernate.Search.Impl.FullTextSessionImpl' does not implement interface member 'NHibernate.ISession.QueryOver(string)'
  • Error 3 'NHibernate.Search.Impl.FullTextSessionImpl' does not implement interface member 'NHibernate.ISession.Merge(string, T)'
  • Error 4 'NHibernate.Search.Impl.FullTextSessionImpl' does not implement interface member 'NHibernate.ISession.Merge(T)'
  • Warning 5 Member 'NHibernate.Search.Filter.ChainedFilter.Bits(Lucene.Net.Index.IndexReader)' overrides obsolete member 'Lucene.Net.Search.Filter.Bits(Lucene.Net.Index.IndexReader)'. Add the Obsolete attribute to 'NHibernate.Search.Filter.ChainedFilter.Bits(Lucene.Net.Index.IndexReader)'.

Anybody ever tried to get a NHibernate Search compatible with 3.2?

hardywang
  • 4,864
  • 11
  • 65
  • 101
  • have you tried to fix the compiler errors? obviously there are additional interfacemethods which have to be implemented. I dont know the code but it NH.Search will probably just delegate through – Firo Jan 06 '12 at 15:11

1 Answers1

0

I've just tried downloading the source code of Nhibernate.Search, and compiling it against the latest version of NHibernate (3.2) and Lucene.Net (2.9.4). I haven't tested it extensively, but everything seems to work till now.

All you need to do is map the methods you mentioned to session.[method_name]() (see below), and replace all references to ISet<> to Iesi.Collections.Generic.ISet<, as the .Net 4 framework includes an native ISet<> class which creates a conflict.


Add this code to the FullTextSessionImpl class:

#region ISession Members


    public T Merge<T>(string entityName, T entity) where T : class
    {
        return session.Merge<T>(entityName, entity);

    }

    public T Merge<T>(T entity) where T : class
    {
        return session.Merge<T>(entity);

    }

    public IQueryOver<T, T> QueryOver<T>(string entityName, Expression<Func<T>> alias) where T : class
    {
        return session.QueryOver<T>(entityName, alias);

    }

    public IQueryOver<T, T> QueryOver<T>(string entityName) where T : class
    {
        return session.QueryOver<T>(entityName);

    }

    #endregion

If you still cannot manage, I can send you the compiled binaries.

Karl Cassar
  • 6,043
  • 10
  • 47
  • 84