gpt4 book ai didi

solr - 将 solr 1.4 索引升级到 solr 3.3?

转载 作者:行者123 更新时间:2023-12-04 11:59:12 25 4
gpt4 key购买 nike

我有一个使用 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/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>

    关于solr - 将 solr 1.4 索引升级到 solr 3.3?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6649583/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com