加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

DataDir and DirectoryFactory in SolrConfig

发布时间:2020-12-15 23:06:18 所属栏目:百科 来源:网络整理
导读:Specifying a Location for Index Data with thedataDirParameter By default,Solr stores its index data in a directory called/dataunder the Solr home. If you would like to specify a different directory for storing index data,use thedataDirpara

Specifying a Location for Index Data with thedataDirParameter

By default,Solr stores its index data in a directory called/dataunder the Solr home. If you would like to specify a different directory for storing index data,use the<dataDir>parameter in thesolrconfig.xmlfile. 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 inLegacy 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 defaultsolr.StandardDirectoryFactoryis 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,orsolr.SimpleFSDirectoryFactory.

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

Thesolr.RAMDirectoryFactoryis memory based,not persistent,and does not work with replication. Use this DirectoryFactory to store your index in RAM.

<directoryFactoryclass="org.apache.solr.core.RAMDirectoryFactory"/>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读