I struggled with this a bit, and finally ended up doing this...
Config File
========================================================
<session-factory>
<property
name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</
property>
<property
name="connection.driver_class">NHibernate.Driver.SqlClientDriver</
property>
<property name="connection.connection_string">
Server=127.0.0.1;initial catalog=Blah;Integrated Security=SSPI
</property>
<property name="show_sql">false</property>
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
<!-- SEARCH CONFIG: DON'T WORK :( -->
<!--
<property name="hibernate.search.default.indexBase">c:\Code
\Blah.com\App_Data\Lucene</property>
<property
name="hibernate.search.default.directory_provider">NHibernate.Search.Storage.FSDirectoryProvider,
NHibernate.Search</property>
-->
<mapping assembly="Blah.Data" />
<listener
class="NHibernate.Search.Event.FullTextIndexEventListener,NHibernate.Search"
type="post-insert"/>
<listener
class="NHibernate.Search.Event.FullTextIndexEventListener,NHibernate.Search"
type="post-update"/>
<listener
class="NHibernate.Search.Event.FullTextIndexEventListener,NHibernate.Search"
type="post-delete"/>
</session-factory>
Global.asax.cs (Or wherever you start your app / create your session
factory)
========================================================
private void TweakConfigurationToAllowForLucene()
{
var config = new Configuration();
config.AddProperties(new Dictionary<string, string>
{
{"hibernate.search.default.directory_provider","NHibernate.Search.Store.FSDirectoryProvider,
NHibernate.Search"}
,{"hibernate.search.default.indexBase",@"C:\Code\Blah.com
\App_Data\Lucene"}
}
});
config.Configure();
_factory = config.BuildSessionFactory();
}
I'm sure that there's a better way, but I ran out of time searching.
This definately feels like a hack though - the config should just
work. If I get time to look into it further I'll share on this thread.
Tobin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---