Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Access \ Get the IndexWriter that Hibernate Search Uses
PostPosted: Mon Dec 19, 2011 5:50 am 
Newbie

Joined: Mon Dec 19, 2011 5:44 am
Posts: 3
Hi,

If I want to override \ extend the default behavior of Hibernate Search

Is there a way to get & use the IndexWriter that Hibernate Search uses?
Are there any interceptors \ hooks for the update \ delete operations?

Thanks,
Arik


Top
 Profile  
 
 Post subject: Re: Access \ Get the IndexWriter that Hibernate Search Uses
PostPosted: Mon Dec 19, 2011 7:05 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
arikgold wrote:
If I want to override \ extend the default behavior of Hibernate Search

Which behavior in particular do you want to override? There are several things you
can configure and/or provide custom implementations for.

arikgold wrote:
Is there a way to get & use the IndexWriter that Hibernate Search uses?
Are there any interceptors \ hooks for the update \ delete operations?

There is no way to get hold of the IndexWriter. Potentially you could implement a custom
BackendQueueProcessor, but it all depends on what you want to do.

Can you provide some more details about your usecase?

--Hardy


Top
 Profile  
 
 Post subject: Re: Access \ Get the IndexWriter that Hibernate Search Uses
PostPosted: Tue Dec 20, 2011 5:17 am 
Newbie

Joined: Mon Dec 19, 2011 5:44 am
Posts: 3
Hi Hardy!

Thanks for the quick response!
In our system, we need to have multiple index records for single object.
Hence I want to index the same object twice.

I actually extended the LuceneBackendQueueProcessor, and added additional lucene works.

It solved my problem.

Now I have other issue that the IndexWriter that I fetch from the LuceneBackendQueueProcessor remains locked...

should I close the writer when finished using it? (shouldn't it remain open for next uses?)


Top
 Profile  
 
 Post subject: Re: Access \ Get the IndexWriter that Hibernate Search Uses
PostPosted: Wed Dec 21, 2011 1:25 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2296
Location: Third rock from the Sun
Hi,
the IndexWriter lifecycle depends on configuration. Closing one and re-opening for each update work is expensive in terms of performance and lots of disk I/O, so the default is to keep it open, and only flush changes at the end of each transaction.

See exclusive_index_use at http://docs.jboss.org/hibernate/search/4.0/reference/en-US/html_single/#table-performance-parameters

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.