转:
怎样合并solr索引?
有些时候,我们有两个以上的索引,然后我们需要合并它们。这里有一个简单易用的方法,使用Lucene-misc 中的 IndeMergeTool。
- 首先,确定你使用的lucene的版本。你可以从solr.war包中查到你lucene的版本。
- 下载该版本的lucene
- 需要合并的索引 必须被关闭。
- 然后,你可以使用下面的命令:java -cp /path/to/lucene-core-VERSION.jar:/path/to/lucene-misc-VERSION.jar org/apache/lucene/misc/IndexMergeTool /path/to/newindex /path/to/index1 /path/to/index2 这个命令将会把index1和index2 的索引合并到newindex中。
例子:
- java -cp /tmp/lucene-core-2007-05-20_00-04-53.jar:./lucene-2.2.0/contrib/misc/lucene-misc-2.2.0.jar org/apache/lucene/misc/IndexMergeTool ./newindex ./app1/solr/data/index ./app2/solr/data/index
本文介绍了一种简便的方法来合并多个Solr索引。通过使用Lucene-misc中的IndexMergeTool工具,可以轻松地将两个或多个索引合并到一个新的索引中。此过程需要先确定Lucene版本,并确保待合并的索引处于关闭状态。



374

被折叠的 条评论
为什么被折叠?



