微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

DataDir and DirectoryFactory in SolrConfig

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"/>

原文地址:https://www.jb51.cc/xml/299228.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。