-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: [Hibernate Search] Define properties programmatically
PostPosted: Fri Jul 20, 2007 9:49 am 
Newbie

Joined: Fri Jun 29, 2007 5:01 am
Posts: 12
Hi all,

is there a way to define the HS properties like DirectoryProvider, IndexBase and batch_size in the code and NOT in the persistence.xml. I would like to change the indexBase during runtime, without the need to redeploy the full appliation...


thanks in advance


henning


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 23, 2007 9:34 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Do you mean at runtime but without redeploying the SessionFactory (not talking about the application here)?
Then no it's not possible. What is your use case?
You can write a custom DirectoryProvider that deals with such hot directory swapping, though.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2007 6:00 am 
Newbie

Joined: Fri Jun 29, 2007 5:01 am
Posts: 12
hi emmanuel,

thanks for your suggestion. I think a custom DirectoryProvider will be the solution. I want to switch indices at runtime to be able to reindex my stuff without disturbing the search feature. i´m still evaluating the possibilities...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2007 7:50 am 
Newbie

Joined: Fri Jun 29, 2007 5:01 am
Posts: 12
A custom DirectoryProvider did the job. The only thing was to set a new DocumentBuilder for the mapped class with the changed FSDirectory...

I am now able to change the index dir at runtime through a System property.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 2:59 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Ah I see. I think FSSlaveDirectoryProvider might have done the trick as well. Go check the code.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.