Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I haven't tried this myself, but AddConfiguration takes a dictionary of cfgProperties, which I guess you can pass the tenant specific hibernate.search.default.indexBase value to.</p> <p>I had a look at this, adding the key as described above will cause a problem if you attempt to use CfgHelper.LoadConfiguration() since it will return null. </p> <p>But you can configure NHSearch to use different directories for each factory using the factory key:</p> <pre><code> &lt;nhs-configuration xmlns="urn:nhs-configuration-1.0"&gt; &lt;search-factory sessionFactoryName="YOUR_TENANT1_FACTORY_KEY"&gt; &lt;property name="hibernate.search.default.indexBase"&gt;~\IndexTenant1&lt;/property&gt; &lt;/search-factory&gt; &lt;search-factory sessionFactoryName="YOUR_TENANT2_FACTORY_KEY"&gt; &lt;property name="hibernate.search.default.indexBase"&gt;~\Tenant2&lt;/property&gt; &lt;/search-factory&gt; &lt;/nhs-configuration&gt; </code></pre> <p>If you are following instructions on <a href="http://wiki.sharparchitecture.net/Default.aspx?Page=NHibSearch" rel="nofollow">http://wiki.sharparchitecture.net/Default.aspx?Page=NHibSearch</a> You would need to change the method GetIndexDirectory to</p> <pre><code> private string GetIndexDirectory() { INHSConfigCollection nhsConfigCollection = CfgHelper.LoadConfiguration(); string factoryKey = SessionFactoryAttribute.GetKeyFrom(this); // Change this with however you get the factory key for your tenants, string property = nhsConfigCollection.GetConfiguration(factoryKey).Properties["hibernate.search.default.indexBase"]; var fi = new FileInfo(property); return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fi.Name); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload