You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ahson Iqbal <mi...@yahoo.com> on 2011/09/30 08:45:04 UTC

Lucene 3.4.0 Merging

Hi

I have 3 solr3.4.0 indexes i want to merge them, after searching on web i found that there are two ways to do it as

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

i am using the 1st method for this i have downloaded lucene 3.4.0 and unpack it and then run following command on command prompt


java -cp d:/lucene/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/indexbut unfortunately it gives me following exception 

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

org/apache/lucene/misc/IndexMergeTool


can any body guide me about this

Regards
Ahsan

Re: Lucene 3.4.0 Merging

Posted by Ahson Iqbal <mi...@yahoo.com>.
Hi Steve

Thanks a lot for all the help,before reading your last response, I have created a new java application in net beans and add both the jars as library to the newly created application,
and in the main method I have called IndexMergeTool.main and pass all command line arguments to this method, and this work fine. But this process start optimizing index after merging and that is taking a long time, can u tell me how can i control this procedure by some parameter, 

Regards
Ahsan


From: Steven A Rowe <sa...@syr.edu>

To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
Sent: Sunday, October 2, 2011 6:49 AM
Subject: RE: Lucene 3.4.0 Merging

Ahsan, 

Maybe one or both of the Lucene jar files are not where your classpath says they are?  Try copying them into the current directory, then adjusting the classpath entries, like so:

java -cp lucene-core-3.4.0.jar;lucene-misc-3.4.0.jar org/apache/lucene/misc/IndexMergeTool ./newindex ./app1/solr/data/index ./app2/solr/data/index

If that doesn't work, tell us about your environment: operating system, java version and vendor.

Steve

> -----Original Message-----
> From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> Sent: Sunday, October 02, 2011 9:30 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Lucene 3.4.0 Merging
> 
> Hi Steve
> 
> Still same problem
> 
> Regards
> Ahsan
> 
>  ----- Original Message -----
> 
> From: Steven A Rowe <sa...@syr.edu>
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> Cc:
> Sent: Sunday, October 2, 2011 1:06 AM
> Subject: RE: Lucene 3.4.0 Merging
> 
> Ahsan,
> 
> You have one other problem: on windows, you should use ";" instead of ":"
> to separate the classpath entries - also, it's good to be in the habit of
> enclosing windows paths in quotation marks, in case one of the sub-
> directories has a space in its name:
> 
> java -cp "d:/lucene/lucene-core-3.4.0.jar;./contrib/misc/lucene-misc-
> 3.4.0.jar" org/apache/lucene/misc/IndexMergeTool ./newindex
> ./app1/solr/data/index ./app2/solr/data/index
> 
> Steve
> 
> > -----Original Message-----
> > From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> > Sent: Saturday, October 01, 2011 12:51 PM
> > To: solr-user@lucene.apache.org
> > Subject: Re: Lucene 3.4.0 Merging
> >
> > Hi Steve
> >
> > Thank you very much for your valued response but adding space as you
> have
> > mentioned does not solve the problem.
> >
> > Regards
> > Ahsan
> >
> > ________________________________
> > From: Steven A Rowe <sa...@syr.edu>
> > To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> > Sent: Friday, September 30, 2011 10:56 AM
> > Subject: RE: Lucene 3.4.0 Merging
> >
> > Hi Ahson,
> >
> > The wiki page you got your cmdline invocation from
> > <http://wiki.apache.org/solr/MergingSolrIndexes> was missing a space
> > character between the classpath and
> > "org/apache/lucene/misc/IndexMergeTool".  I've just updated that page.
> >
> > Steve
> >
> > > -----Original Message-----
> > > From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> > > Sent: Friday, September 30, 2011 2:45 AM
> > > To: Solr Send Mail
> > > Subject: Lucene 3.4.0 Merging
> > >
> > > Hi
> > >
> > > I have 3 solr3.4.0 indexes i want to merge them, after searching on
> web
> > i
> > > found that there are two ways to do it as
> > >
> > > 1. Using Lucene Merge tool.
> > > 2. Merging through core admin
> > >
> > > i am using the 1st method for this i have downloaded lucene 3.4.0 and
> > > unpack it and then run following command on command prompt
> > >
> > >
> > > java -cp d:/lucene/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/indexbut unfortunately it
> gives
> > > me following exception
> > >
> > > Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
> > >
> > > org/apache/lucene/misc/IndexMergeTool
> > >
> > >
> > > can any body guide me about this
> > >
> > > Regards
> > > Ahsan

RE: Lucene 3.4.0 Merging

Posted by Steven A Rowe <sa...@syr.edu>.
Ahsan, 

Maybe one or both of the Lucene jar files are not where your classpath says they are?  Try copying them into the current directory, then adjusting the classpath entries, like so:

java -cp lucene-core-3.4.0.jar;lucene-misc-3.4.0.jar org/apache/lucene/misc/IndexMergeTool ./newindex ./app1/solr/data/index ./app2/solr/data/index

If that doesn't work, tell us about your environment: operating system, java version and vendor.

Steve

> -----Original Message-----
> From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> Sent: Sunday, October 02, 2011 9:30 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Lucene 3.4.0 Merging
> 
> Hi Steve
> 
> Still same problem
> 
> Regards
> Ahsan
> 
>  ----- Original Message -----
> 
> From: Steven A Rowe <sa...@syr.edu>
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> Cc:
> Sent: Sunday, October 2, 2011 1:06 AM
> Subject: RE: Lucene 3.4.0 Merging
> 
> Ahsan,
> 
> You have one other problem: on windows, you should use ";" instead of ":"
> to separate the classpath entries - also, it's good to be in the habit of
> enclosing windows paths in quotation marks, in case one of the sub-
> directories has a space in its name:
> 
> java -cp "d:/lucene/lucene-core-3.4.0.jar;./contrib/misc/lucene-misc-
> 3.4.0.jar" org/apache/lucene/misc/IndexMergeTool ./newindex
> ./app1/solr/data/index ./app2/solr/data/index
> 
> Steve
> 
> > -----Original Message-----
> > From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> > Sent: Saturday, October 01, 2011 12:51 PM
> > To: solr-user@lucene.apache.org
> > Subject: Re: Lucene 3.4.0 Merging
> >
> > Hi Steve
> >
> > Thank you very much for your valued response but adding space as you
> have
> > mentioned does not solve the problem.
> >
> > Regards
> > Ahsan
> >
> > ________________________________
> > From: Steven A Rowe <sa...@syr.edu>
> > To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> > Sent: Friday, September 30, 2011 10:56 AM
> > Subject: RE: Lucene 3.4.0 Merging
> >
> > Hi Ahson,
> >
> > The wiki page you got your cmdline invocation from
> > <http://wiki.apache.org/solr/MergingSolrIndexes> was missing a space
> > character between the classpath and
> > "org/apache/lucene/misc/IndexMergeTool".  I've just updated that page.
> >
> > Steve
> >
> > > -----Original Message-----
> > > From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> > > Sent: Friday, September 30, 2011 2:45 AM
> > > To: Solr Send Mail
> > > Subject: Lucene 3.4.0 Merging
> > >
> > > Hi
> > >
> > > I have 3 solr3.4.0 indexes i want to merge them, after searching on
> web
> > i
> > > found that there are two ways to do it as
> > >
> > > 1. Using Lucene Merge tool.
> > > 2. Merging through core admin
> > >
> > > i am using the 1st method for this i have downloaded lucene 3.4.0 and
> > > unpack it and then run following command on command prompt
> > >
> > >
> > > java -cp d:/lucene/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/indexbut unfortunately it
> gives
> > > me following exception
> > >
> > > Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
> > >
> > > org/apache/lucene/misc/IndexMergeTool
> > >
> > >
> > > can any body guide me about this
> > >
> > > Regards
> > > Ahsan

Re: Lucene 3.4.0 Merging

Posted by Ahson Iqbal <mi...@yahoo.com>.
Hi Steve

Still same problem

Regards
Ahsan

 ----- Original Message -----

From: Steven A Rowe <sa...@syr.edu>
To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
Cc: 
Sent: Sunday, October 2, 2011 1:06 AM
Subject: RE: Lucene 3.4.0 Merging

Ahsan,

You have one other problem: on windows, you should use ";" instead of ":" to separate the classpath entries - also, it's good to be in the habit of enclosing windows paths in quotation marks, in case one of the sub-directories has a space in its name:

java -cp "d:/lucene/lucene-core-3.4.0.jar;./contrib/misc/lucene-misc-3.4.0.jar" org/apache/lucene/misc/IndexMergeTool ./newindex ./app1/solr/data/index ./app2/solr/data/index

Steve

> -----Original Message-----
> From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> Sent: Saturday, October 01, 2011 12:51 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Lucene 3.4.0 Merging
> 
> Hi Steve
> 
> Thank you very much for your valued response but adding space as you have
> mentioned does not solve the problem.
> 
> Regards
> Ahsan
> 
> ________________________________
> From: Steven A Rowe <sa...@syr.edu>
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> Sent: Friday, September 30, 2011 10:56 AM
> Subject: RE: Lucene 3.4.0 Merging
> 
> Hi Ahson,
> 
> The wiki page you got your cmdline invocation from
> <http://wiki.apache.org/solr/MergingSolrIndexes> was missing a space
> character between the classpath and
> "org/apache/lucene/misc/IndexMergeTool".  I've just updated that page.
> 
> Steve
> 
> > -----Original Message-----
> > From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> > Sent: Friday, September 30, 2011 2:45 AM
> > To: Solr Send Mail
> > Subject: Lucene 3.4.0 Merging
> >
> > Hi
> >
> > I have 3 solr3.4.0 indexes i want to merge them, after searching on web
> i
> > found that there are two ways to do it as
> >
> > 1. Using Lucene Merge tool.
> > 2. Merging through core admin
> >
> > i am using the 1st method for this i have downloaded lucene 3.4.0 and
> > unpack it and then run following command on command prompt
> >
> >
> > java -cp d:/lucene/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/indexbut unfortunately it gives
> > me following exception
> >
> > Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
> >
> > org/apache/lucene/misc/IndexMergeTool
> >
> >
> > can any body guide me about this
> >
> > Regards
> > Ahsan

RE: Lucene 3.4.0 Merging

Posted by Steven A Rowe <sa...@syr.edu>.
Ahsan,

You have one other problem: on windows, you should use ";" instead of ":" to separate the classpath entries - also, it's good to be in the habit of enclosing windows paths in quotation marks, in case one of the sub-directories has a space in its name:

java -cp "d:/lucene/lucene-core-3.4.0.jar;./contrib/misc/lucene-misc-3.4.0.jar" org/apache/lucene/misc/IndexMergeTool ./newindex ./app1/solr/data/index ./app2/solr/data/index

Steve

> -----Original Message-----
> From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> Sent: Saturday, October 01, 2011 12:51 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Lucene 3.4.0 Merging
> 
> Hi Steve
> 
> Thank you very much for your valued response but adding space as you have
> mentioned does not solve the problem.
> 
> Regards
> Ahsan
> 
> ________________________________
> From: Steven A Rowe <sa...@syr.edu>
> To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
> Sent: Friday, September 30, 2011 10:56 AM
> Subject: RE: Lucene 3.4.0 Merging
> 
> Hi Ahson,
> 
> The wiki page you got your cmdline invocation from
> <http://wiki.apache.org/solr/MergingSolrIndexes> was missing a space
> character between the classpath and
> "org/apache/lucene/misc/IndexMergeTool".  I've just updated that page.
> 
> Steve
> 
> > -----Original Message-----
> > From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> > Sent: Friday, September 30, 2011 2:45 AM
> > To: Solr Send Mail
> > Subject: Lucene 3.4.0 Merging
> >
> > Hi
> >
> > I have 3 solr3.4.0 indexes i want to merge them, after searching on web
> i
> > found that there are two ways to do it as
> >
> > 1. Using Lucene Merge tool.
> > 2. Merging through core admin
> >
> > i am using the 1st method for this i have downloaded lucene 3.4.0 and
> > unpack it and then run following command on command prompt
> >
> >
> > java -cp d:/lucene/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/indexbut unfortunately it gives
> > me following exception
> >
> > Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
> >
> > org/apache/lucene/misc/IndexMergeTool
> >
> >
> > can any body guide me about this
> >
> > Regards
> > Ahsan

Re: Lucene 3.4.0 Merging

Posted by Ahson Iqbal <mi...@yahoo.com>.
Hi Steve

Thank you very much for your valued response but adding space as you have mentioned does not solve the problem.

Regards
Ahsan





________________________________
From: Steven A Rowe <sa...@syr.edu>
To: "solr-user@lucene.apache.org" <so...@lucene.apache.org>
Sent: Friday, September 30, 2011 10:56 AM
Subject: RE: Lucene 3.4.0 Merging

Hi Ahson,

The wiki page you got your cmdline invocation from <http://wiki.apache.org/solr/MergingSolrIndexes> was missing a space character between the classpath and "org/apache/lucene/misc/IndexMergeTool".  I've just updated that page.

Steve

> -----Original Message-----
> From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> Sent: Friday, September 30, 2011 2:45 AM
> To: Solr Send Mail
> Subject: Lucene 3.4.0 Merging
> 
> Hi
> 
> I have 3 solr3.4.0 indexes i want to merge them, after searching on web i
> found that there are two ways to do it as
> 
> 1. Using Lucene Merge tool.
> 2. Merging through core admin
> 
> i am using the 1st method for this i have downloaded lucene 3.4.0 and
> unpack it and then run following command on command prompt
> 
> 
> java -cp d:/lucene/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/indexbut unfortunately it gives
> me following exception
> 
> Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
> 
> org/apache/lucene/misc/IndexMergeTool
> 
> 
> can any body guide me about this
> 
> Regards
> Ahsan

RE: Lucene 3.4.0 Merging

Posted by Steven A Rowe <sa...@syr.edu>.
Hi Ahson,

The wiki page you got your cmdline invocation from <http://wiki.apache.org/solr/MergingSolrIndexes> was missing a space character between the classpath and "org/apache/lucene/misc/IndexMergeTool".  I've just updated that page.

Steve

> -----Original Message-----
> From: Ahson Iqbal [mailto:mianahson@yahoo.com]
> Sent: Friday, September 30, 2011 2:45 AM
> To: Solr Send Mail
> Subject: Lucene 3.4.0 Merging
> 
> Hi
> 
> I have 3 solr3.4.0 indexes i want to merge them, after searching on web i
> found that there are two ways to do it as
> 
> 1. Using Lucene Merge tool.
> 2. Merging through core admin
> 
> i am using the 1st method for this i have downloaded lucene 3.4.0 and
> unpack it and then run following command on command prompt
> 
> 
> java -cp d:/lucene/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/indexbut unfortunately it gives
> me following exception
> 
> Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
> 
> org/apache/lucene/misc/IndexMergeTool
> 
> 
> can any body guide me about this
> 
> Regards
> Ahsan