将solr 1.4索引升级到solr 3.3?

发布于 2024-11-19 13:47:24 字数 147 浏览 7 评论 0原文

我有一个使用 apache solr 1.4 构建的现有索引。

我想在 3.3 版本中使用这个现有索引。正如您所知,索引格式在 3.x 之后发生了变化,那么如何才能做到这一点呢?

我已经使用 Luke 将现有索引(即 1.4 版本)导出为 XML。

I have an existing index build using apache solr 1.4.

I want to use this existing index in version 3.3. As you know the index format is changed after 3.x, so how is it possible to do this?

I have exported the existing index (that is in 1.4 version) using Luke to XML.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

極樂鬼 2024-11-26 13:47:24

有两种方法可以做到这一点:

  1. 如果您的索引未优化,则只需对其进行优化 - 这将同时升级文件格式。

  2. 如果您的索引已经优化,则无法执行此操作。相反,使用 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/目录
    

但是,请注意,这只会更改文件格式 - 它不会停止弃用警告,因为除非您另有说明,否则 solrconfig.xml 默认仍然假设您正在使用旧的索引格式。请参阅 http://www.mail-archive.com/[电子邮件受保护]/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>

There's two ways to do this:

  1. if your index is unoptimized, then simply optimize it - this will upgrade the file format along the way.

  2. if your index is already optimized, you can't do this. Instead, use the command line tool supplied with solr (your path may differ from mine

    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
    

However, note that this only changes the file format - it won't stop deprecation warnings because unless you tell it otherwise, solrconfig.xml defaults to still assuming you're using an old index format. see http://www.mail-archive.com/[email protected]/msg23233.html

You may still get lots of lines like this in your logfile:

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

until you tell solrconfig.xml that you're ready to use all the features of the new index format. You do this by adding the following to solrconfig.xml (at the top level, just after the abortOnConfigurationError setting).

<!-- 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>
凉宸 2024-11-26 13:47:24

如果你有数据:最好的方法是索引 solr 3.3 中的所有新数据
您可以使用数据导入处理程序来索引导出的 XML 文件。

如果建立新索引不适合您,那么您有不同的可能性:

据我所知,Solr 3.3 可以读取旧索引。
因此,一种想法可能是使用分片。一个分片用于旧数据(只读),另一个分片用于新数据。不幸的是,在此解决方案中您将无法修改旧数据。

If you have the data: the best way is indexing all the data new in solr 3.3
You can use the data import handler to index your exported XML files.

If building up a new index is not an solution for you, you have got different possibilities:

As far as i know, Solr 3.3 can read old indexes.
So one idea could be using shards. One shard for the old data (read only) an the other shard for the new data. Unfortunately, in this solution you will be unable to modify old data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文