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