-->
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.  [ 2 posts ] 
Author Message
 Post subject: Dynamically Adding search Directory Provider
PostPosted: Sun May 04, 2008 5:33 am 
Newbie

Joined: Sun Jun 18, 2006 9:47 pm
Posts: 6
Normally to add a Directory to your Lucene Search Directory one would add
Code:
<property name="hibernate.search.default.indexBase">
      c:/index2
   </property>

to hibernate.cfg.xml

and to retrieve this from the FullTextSession one would write
Code:
FullTextSession fullTextSession = Search.createFullTextSession(session);
DirectoryProvider[] directoryProvider=   fullTextSession.getSearchFactory().getDirectoryProviders(JobDescription.class);


My question is , Is it possible to set the Directory at runtime, instead of having to put the value inside a hibernate.cfg.xml


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 05, 2008 6:59 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I guess there are two things one could do. Firstly you could configure progammatically using Hibernate's configuration API. You could then set the hibernate.search.default.indexBase property at startup.
Secondly, you could implement a custom DirectoryProvider, maybe by extending the provided FSDirectoryProvider. You can then specify your custom provider by setting the property: hibernate.search.default.directory_provider.

It really depends on what you are trying to do?

--Hardy


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