Thanks Emmanuel and Hardy for your response.
Hardy: I solved the problem. We have a custom backend and the run method of the backendqueueprocessor for some reason gets DeleteLuceneWork when I'm doing this bulk update. That was the source of the problem.
Code:
public void run() {
List<LuceneWork> filteredQueue = new ArrayList<LuceneWork>(queue);
for (LuceneWork work : queue)
{
if (work instanceof OptimizeLuceneWork || work instanceof DeleteLuceneWork)
{
// we don't want optimization to be propagated
filteredQueue.remove(work);
}
}
:
}
for now, I'm removing the DeleteLuceneWork from the queue but I still need to find out why I'm getting the DeleteLuceneWork when all I'm trying to do is bulk index.
Emmanuel: I'm using batch size as 1000
In 3.0.1 GA, is there a need to flush the session as well? I'm doing it though Hibernate Search in Action book, you had mentioned just session.clear
Code:
if (index % 1000 == 0)
{
// hibernateSession.clear();
fullTextSession.flush(); //Is this needed?
fullTextSession.clear(); //clear since the queue is processed
System.out.print(new Date() + " ... batch flush ...");
}
Quote:
Actually a better approach has been added to Hibernate 3.1 with an explicit session.flushToIndexes() method.
But Hibernate Search 3.1, requires hibernate core 3.3 and Hibernate annotations and EM 3.4 and I've no idea when JBoss will migrate to the latest versions so we can actually start using Hibernate Search the way its supposed to be. Since my company has a enterprise licence with JBoss we can only use what JBoss provides us. So unfortunate, since they haven't still upgraded the hibernate annotations/em jars which are from dec 2006! :(
BTW, I'm very impressed with whatever I have seen so far with Hibernate Search
Flexibility: Write your own backend if you need to
Annotations: So cool! :)
Custom Bridges: You guys thought of everything that ppl will need out of the box.
I just hope JBoss upgrades their hibernate annotations/em for their EAP 4.3 version so I can officially start using Hibernate Search.
Thanks,
Apparna