Solr1.4在建索引的时候默认使用复合文件格式,在索引较大时无疑会增加索引创建的时间以及系统的IO。对于没有使用master/slave架构的应用来说,这样做鸭梨很大。
本文将阐述如何改变这一默认策略:
1、环境描述
Solr1.4
multicore
使用core1做例子
2、方法
打开core1/conf/solrconfig.xml
在其中添加:
<indexDefaults>
<useCompoundFile>false</useCompoundFile>
</indexDefaults>
保存文件
重启web服务器即可
3、扩展
还有一些其它参数的选项也可以加到这里,如:maxBufferedDocs/maxMergeDocs/mergeFactor等
具体请查看SolrIndexConfig类的构造函数。
4、附
修改后的solrconfig.xml: