You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by saisantoshi <sa...@gmail.com> on 2013/01/23 01:30:22 UTC

Are Search Index directories backward comptabile? ( when upgrading to latest lucene version)

While upgrading from one version to another version ( in our case : 2.4 -
4.0). Do we need to flush out the existing search index directory and
rebuild new one. What are the best practices here? Are the existing search
index directories not backward compatible?

Thanks
Sai



--
View this message in context: http://lucene.472066.n3.nabble.com/Are-Search-Index-directories-backward-comptabile-when-upgrading-to-latest-lucene-version-tp4035494.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Are Search Index directories backward comptabile? ( when upgrading to latest lucene version)

Posted by Ian Lea <ia...@gmail.com>.
Lucene 4.x cannot read indexes created with 2.x.  You can change and
recompile your code to 4.x in one go.  Since you can reindex, I'd make
all the code changes and then recreate the indexes using 4.x.  With a
bit of testing along the way of course.


--
Ian.


On Wed, Jan 23, 2013 at 7:34 AM, saisantoshi <sa...@gmail.com> wrote:
> Also, I am not sure about the following below statement:
>
>>>A direct update from 2.x to 4.0 is not possible
>
> Are you saying that its impossible to upgrade from 2.4 - 4.0 version? Why
> can't we upgrade? Any technical limitations with Lucene that will not allow
> from upgrading from 2.4 - 4.x?.
>
> I am directly upgrading from 2.4 - 4.x but not sure about any problems with
> respect to compilation against 4.x apart from the API changes. I am fixing
> them but not sure about any other issues? As far as the indexing is
> considered, we are thinking of deleting all the existing indexes and
> recreating with the newer version (4.0).
>
> We don't want to take an extra hop ( 2.4 - 3.6.2 and 3.6.2 - 4.x) which
> would cause more work for us.
>
> Please let us know of any issues with the above approach.
>
> Thanks,
> Sai
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Are-Search-Index-directories-backward-comptabile-when-upgrading-to-latest-lucene-version-tp4035494p4035542.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: Are Search Index directories backward comptabile? ( when upgrading to latest lucene version)

Posted by saisantoshi <sa...@gmail.com>.
Also, I am not sure about the following below statement:

>>A direct update from 2.x to 4.0 is not possible

Are you saying that its impossible to upgrade from 2.4 - 4.0 version? Why
can't we upgrade? Any technical limitations with Lucene that will not allow
from upgrading from 2.4 - 4.x?. 

I am directly upgrading from 2.4 - 4.x but not sure about any problems with
respect to compilation against 4.x apart from the API changes. I am fixing
them but not sure about any other issues? As far as the indexing is
considered, we are thinking of deleting all the existing indexes and
recreating with the newer version (4.0).

We don't want to take an extra hop ( 2.4 - 3.6.2 and 3.6.2 - 4.x) which
would cause more work for us. 

Please let us know of any issues with the above approach.

Thanks,
Sai



--
View this message in context: http://lucene.472066.n3.nabble.com/Are-Search-Index-directories-backward-comptabile-when-upgrading-to-latest-lucene-version-tp4035494p4035542.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: Are Search Index directories backward comptabile? ( when upgrading to latest lucene version)

Posted by saisantoshi <sa...@gmail.com>.
Thanks. We decided to delete the existing index directories and recreate it
once we upgrade to 4.0 (unless we hit any major api blockers during
compilation, we will prefer to go to 3.6.2 first and then later to 4.0).

Thanks,
Sai.



--
View this message in context: http://lucene.472066.n3.nabble.com/Are-Search-Index-directories-backward-comptabile-when-upgrading-to-latest-lucene-version-tp4035494p4035763.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: Are Search Index directories backward comptabile? ( when upgrading to latest lucene version)

Posted by Uwe Schindler <uw...@thetaphi.de>.
No, there are only those 2 options.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: saisantoshi [mailto:saisantoshi76@gmail.com]
> Sent: Wednesday, January 23, 2013 8:11 AM
> To: java-user@lucene.apache.org
> Subject: RE: Are Search Index directories backward comptabile? ( when
> upgrading to latest lucene version)
> 
> We are upgrading from 2.4 - 4.0? What are the options here? ( To delete the
> existing index directories and reindex with the upgraded ones).
> 
> We don't want to take any intermediate steps which would cause more work
> again to upgrade to the latest version.
> 
> Thanks,
> Sai.
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Are-
> Search-Index-directories-backward-comptabile-when-upgrading-to-latest-
> lucene-version-tp4035494p4035538.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: Are Search Index directories backward comptabile? ( when upgrading to latest lucene version)

Posted by saisantoshi <sa...@gmail.com>.
We are upgrading from 2.4 - 4.0? What are the options here? ( To delete the
existing index directories and reindex with the upgraded ones).

We don't want to take any intermediate steps which would cause more work
again to upgrade to the latest version.

Thanks,
Sai.



--
View this message in context: http://lucene.472066.n3.nabble.com/Are-Search-Index-directories-backward-comptabile-when-upgrading-to-latest-lucene-version-tp4035494p4035538.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: Are Search Index directories backward comptabile? ( when upgrading to latest lucene version)

Posted by Uwe Schindler <uw...@thetaphi.de>.
You have to update in 1 extra steps: 2.x -> 3.6.2 and then you can use the index in 4.0, because it can read 3.x indexes. To upgrade to Lucene 3.6, download lucene-core-3.6.2.jar and run:
$ java -cp lucene-core-3.6.2.jar org.apache.lucene.index.IndexUpgrader <indexDir>

After that the binary index format is on the version number 3.6, which can be read by 4.0. A direct update from 2.x to 4.0 is not possible. Also keep in mind that upgrading the index only updates the index format not its contents. Depending on the analyzers you used, you might need to reindex, because the text analysis will behave different in newer Lucene versions resulting in Queries no longer returning results. To make the used analyzers behave like the ones you used in Lucene 2.4, you have to pass Version.LUCENE_24 as matchVersion parameter to your analyzer.

But I still recommend to reindex all your data, especially when the version difference is so big. In that case, you can use the newer Analyzer versions (Version.LUCENE_40).

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: saisantoshi [mailto:saisantoshi76@gmail.com]
> Sent: Wednesday, January 23, 2013 1:30 AM
> To: java-user@lucene.apache.org
> Subject: Are Search Index directories backward comptabile? ( when
> upgrading to latest lucene version)
> 
> While upgrading from one version to another version ( in our case : 2.4 - 4.0).
> Do we need to flush out the existing search index directory and rebuild new
> one. What are the best practices here? Are the existing search index
> directories not backward compatible?
> 
> Thanks
> Sai
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Are-
> Search-Index-directories-backward-comptabile-when-upgrading-to-latest-
> lucene-version-tp4035494.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org