I'm using 1.2.1GA, so maybe you'll tell me to upgrade, and I'd love to
do it, but I think it will probably end up being easier for me to
patch the current NH source than to upgrade to NH2 right now -- the
breaking changes scare me.  So I figured I'd post my issue for
posterity, or in case someone felt like addressing it...

When I do an Update on an entity that is indexed by NHibernate.Search,
it gets indexed several times, so that when I do searches, I get
duplicates.

Watching the logs, it looks like the problem is in SearchInterceptor,
and might be similar to the problem listed in the last comment on this
page: http://www.hibernate.org/138.html

It looks like SearchInterceptor assumes that OnFlushDirty will only
get called once per entity per PreFlush, but the logs suggest
otherwise.

Basically what I see in the logs is

PreFlush
OnFlushDirty Post#155
PreFlush
OnFlushDirty Post#155
PreFlush
OnFlushDirty Post#155
PreFlush
OnFlushDirty Post#155
[SQL statements]
PostFlush: Tag#85, Post#155, Tag#46, User#1
remove from Lucene index: Post#155
remove from Lucene index: Post#155
remove from Lucene index: Post#155
remove from Lucene index: Post#155
add to Lucene index: Post#155
add to Lucene index: Post#155
add to Lucene index: Post#155
add to Lucene index: Post#155

So I think I'm going to have SearchInterceptor.OnFlushDirty() just add
the into a set (to prevent dupes) and then in
SearchInterceptor.PostFlush(), loop through the set and
RegisterIndexing().



--~--~---------~--~----~------------~-------~--~----~
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