Hi,

when I build the initial index from an existing database, the type of
the entries in Lucene get indexed as
<_hibernate_class:Castle.Proxies.MuestraProxy,
DynamicProxyGenAssembly2>

However, when a new entity is added using NHibernate it gets indexed
as <_hibernate_class:RALVet.Model.Muestra, RALVet>} which creates
duplicate entries in Lucene, one as the real class and another one as
its proxy.

I've tried using NHibernateUtil.GetClass() when building the index but
it still returns the proxie.

This is the code that builds the initial index:

private static void CreateIndex<T>()
    {
        var fullTextSession =
 
NHibernate.Search.Search.CreateFullTextSession(BootStrapper.SessionFactory.OpenSession());
        using(var tran = fullTextSession.BeginTransaction())
        {
            var query =
fullTextSession.CreateQuery(string.Concat("from ", typeof (T).Name));

            foreach (var doc in query.List())
            {
                fullTextSession.Index(doc);
            //  fullTextSession.Index(NHibernateUtil.GetClass(doc));
            }
            tran.Commit();
        }
        fullTextSession.Close();
    }

What am I doing wrong? Thanks in advance.

Jose

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to