我有一个使用 apache solr 1.4 构建的现有索引。
我想在 3.3 版本中使用这个现有索引。正如您所知,索引格式在 3.x 之后发生了变化,那么如何才能做到这一点呢?
我已经使用 Luke 将现有索引(即 1.4 版本)导出为 XML。
有两种方法可以做到这一点:
如果您的索引未优化,则只需对其进行优化 - 这将一路升级文件格式。
-
如果您的索引已经优化,则无法执行此操作。相反,使用 solr 提供的命令行工具(您的路径可能与我的不同)
java -cp work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp/WEB-INF/lib/lucene-core-3.3.0.jar org.apache.lucene.index.IndexUpgrader -verbose /path/to/index/directory
但是,请注意,这只会更改文件格式 - 它不会停止弃用警告,因为除非您另有说明,否则 solrconfig.xml 默认情况下仍假设您使用旧的索引格式。看http://www.mail-archive.com/[电子邮件受保护]/msg23233.html http://www.mail-archive.com/dev@lucene.apache.org/msg23233.html
您的日志文件中可能仍然会出现很多这样的行:
WARNING: LowerCaseFilterFactory is using deprecated LUCENE_24 emulation. You should at some point declare and reindex to at least 3.0, because 2.x emulation is deprecated and will be removed in 4.0
直到您告诉 solrconfig.xml 您已准备好使用新索引格式的所有功能。您可以通过将以下内容添加到 solrconfig.xml(在顶层,就在 abortOnConfigurationError 设置之后)来完成此操作。
<!-- Controls what version of Lucene various components of Solr
adhere to. Generally, you want to use the latest version to
get all bug fixes and improvements. It is highly recommended
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
<luceneMatchVersion>LUCENE_33</luceneMatchVersion>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)