开发者

Merging Solr 3.4.0 indexes using lucene Merge Tool

I have three solr 3.4.0 indexes that I want to merge, after searching I've found that there are two ways to do it:

  1. Using Lucene Merge tool.
  2. Merging through core admin

I am using lucene 3.4.0 and running following command:

java -cp d:/luc开发者_如何学JAVAene/lucene-core-3.4.0.jar:./contrib/misc/lucene-misc-3.4.0.jarorg/apache/lucene/misc/IndexMergeTool ./newindex ./app1/solr/data/index ./app2/solr/data/index

but unfortunately it gives me following exception:

Exception in thread "Main Thread" java.lang.NoClassDefFoundError:

org/apache/lucene/misc/IndexMergeTool

Can anybody help me with this?


Couple of things :-

./contrib/misc/lucene-misc-3.4.0.jar

Are you running it from the correct directory for it to find the jar. Why not use full path ?

You are using :(colon) as jar classpath separator, and using windows it should be ; (semi-colon)

Also - If you already have Solr running with the Solr indexes ready, I would recommend you to use the second option - merging through Solr Admin.
This is more easy to use with direct http interface without any additional overheads and would work out of the box.


I solved this particular problem by creating a new java application in net beans 7.1 and adding both the jar files as library. and inside my new application's main method i have called

IndexMergeTool.main

and pass all command line arguments to above mentioned method.

Regards Ahsan

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜