您的位置:首页 > 其它

DataDir and DirectoryFactory in SolrConfig

2014-01-21 00:00 246 查看

Specifying a Location for Index Data with the dataDir Parameter

By default, Solr stores its index data in a directory called /data under the Solr home. If you would like to specify a different directory for storing index data, use the <dataDir> parameter in the solrconfig.xml file. You can specify another directory either with a full pathname or a pathname relative to the current working directory of the servlet container. For example:

<dataDir>/var/data/solr/</dataDir>

If you are using replication to replicate the Solr index (as described in Legacy Scaling and Distribution), then the <dataDir> directory should correspond to the index directory used in the replication configuration.

Specifying the DirectoryFactory For Your Index

The default solr.StandardDirectoryFactory is filesystem based, and tries to pick the best implementation for the current JVM and platform. You can force a particular implementation by specifyingsolr.MMapDirectoryFactory, solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.

<directoryFactory name="DirectoryFactory"

class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>

The solr.RAMDirectoryFactory is memory based, not persistent, and does not work with replication. Use this DirectoryFactory to store your index in RAM.

<directoryFactory class="org.apache.solr.core.RAMDirectoryFactory"/>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Solrconfig.xml
相关文章推荐