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 Ramprakash Ramamoorthy <yo...@gmail.com> on 2012/11/20 11:16:22 UTC

Using Lucene 2.3 indices with Lucene 4.0

I understand lucene 2.x indexes are not compatible with the latest version
of lucene 4.0. However we have all our indexes indexed with lucene 2.3.

Now that we are planning to migrate to Lucene 4.0, is there any work
around/hack I can do, so that I can still read the 2.3 indices? Or is
forgoing the older indices the only option?

P.S : Am afraid, Re-indexing is not feasible.

-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
Chennai,
India.

Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by Ian Lea <ia...@gmail.com>.
Sure - read all the release notes, migration guides, everything, test and
test again.


--
Ian.



On Tue, Nov 20, 2012 at 10:24 AM, Danil ŢORIN <to...@gmail.com> wrote:

> However behavior of some analyzers changed.
>
> So even after upgrade the old index is readable with 4.0, it doesn't mean
> everything still works as before.
>
> On Tue, Nov 20, 2012 at 12:20 PM, Ian Lea <ia...@gmail.com> wrote:
>
> > You can upgrade the indexes with org.apache.lucene.index.IndexUpgrader.
> >  You'll need to do it in steps, from 2.x to 3.x to 4.x, but should work
> > fine as far as I know.
> >
> >
> > --
> > Ian.
> >
> >
> >
> > On Tue, Nov 20, 2012 at 10:16 AM, Ramprakash Ramamoorthy <
> > youngestachiever@gmail.com> wrote:
> >
> > > I understand lucene 2.x indexes are not compatible with the latest
> > version
> > > of lucene 4.0. However we have all our indexes indexed with lucene 2.3.
> > >
> > > Now that we are planning to migrate to Lucene 4.0, is there any work
> > > around/hack I can do, so that I can still read the 2.3 indices? Or is
> > > forgoing the older indices the only option?
> > >
> > > P.S : Am afraid, Re-indexing is not feasible.
> > >
> > > --
> > > With Thanks and Regards,
> > > Ramprakash Ramamoorthy,
> > > Chennai,
> > > India.
> > >
> >
>

Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by Ramprakash Ramamoorthy <yo...@gmail.com>.
On Thu, Nov 29, 2012 at 4:05 AM, kiwi clive <ki...@yahoo.com> wrote:

> Be aware that StandardAnalyzer changed slightly. This is particularly
> important if you use it to analyze email addresses and certain text-numeral
> combinations. My understanding is that the newer version of
> StandardAnalyzer is more consistent with what it should be doing but if you
> relied on its old functionality, that could bite you.
>
> There are two solutions that I am aware of:
> (1) Replace StandardAnalyzer with ClassicAnalyzer which I believe is the
> 'old' StandardAnalayzer before it was fixed.
> (2) Use StandardAnalyzer with Version_23 rather than Version_40.
>
> Cheers,
> Clive
>
> Thank you Chive. That definitely helped!
>
> ________________________________
>  From: Ramprakash Ramamoorthy <yo...@gmail.com>
> To: java-user@lucene.apache.org
> Sent: Tuesday, November 20, 2012 10:31 AM
> Subject: Re: Using Lucene 2.3 indices with Lucene 4.0
>
> On Tue, Nov 20, 2012 at 3:54 PM, Danil ŢORIN <to...@gmail.com> wrote:
>
> > However behavior of some analyzers changed.
> >
> > So even after upgrade the old index is readable with 4.0, it doesn't mean
> > everything still works as before.
> >
>
> Thank you Torin, I am using the standard analyzer only and both the systems
> use Unicode 4.0 and I don't smell any problems here.
>
> >
> > On Tue, Nov 20, 2012 at 12:20 PM, Ian Lea <ia...@gmail.com> wrote:
> >
> > > You can upgrade the indexes with org.apache.lucene.index.IndexUpgrader.
> > >  You'll need to do it in steps, from 2.x to 3.x to 4.x, but should work
> > > fine as far as I know.
> > >
> > >
> > > --
> > > Ian.
> > >
> >
> Thank you Ian, this is giving me some head starts.
>
> > >
> > >
> > > On Tue, Nov 20, 2012 at 10:16 AM, Ramprakash Ramamoorthy <
> > > youngestachiever@gmail.com> wrote:
> > >
> > > > I understand lucene 2.x indexes are not compatible with the latest
> > > version
> > > > of lucene 4.0. However we have all our indexes indexed with lucene
> 2.3.
> > > >
> > > > Now that we are planning to migrate to Lucene 4.0, is there any work
> > > > around/hack I can do, so that I can still read the 2.3 indices? Or is
> > > > forgoing the older indices the only option?
> > > >
> > > > P.S : Am afraid, Re-indexing is not feasible.
> > > >
> > > > --
> > > > With Thanks and Regards,
> > > > Ramprakash Ramamoorthy,
> > > > Chennai,
> > > > India.
> > > >
> > >
> >
>
>
>
> --
> With Thanks and Regards,
> Ramprakash Ramamoorthy,
> Engineer Trainee,
> Zoho Corporation.
> +91 9626975420
>



-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
Engineer Trainee,
Zoho Corporation.
+91 9626975420

Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by kiwi clive <ki...@yahoo.com>.
Be aware that StandardAnalyzer changed slightly. This is particularly important if you use it to analyze email addresses and certain text-numeral combinations. My understanding is that the newer version of StandardAnalyzer is more consistent with what it should be doing but if you relied on its old functionality, that could bite you.

There are two solutions that I am aware of:
(1) Replace StandardAnalyzer with ClassicAnalyzer which I believe is the 'old' StandardAnalayzer before it was fixed.
(2) Use StandardAnalyzer with Version_23 rather than Version_40.

Cheers,
Clive



________________________________
 From: Ramprakash Ramamoorthy <yo...@gmail.com>
To: java-user@lucene.apache.org 
Sent: Tuesday, November 20, 2012 10:31 AM
Subject: Re: Using Lucene 2.3 indices with Lucene 4.0
 
On Tue, Nov 20, 2012 at 3:54 PM, Danil ŢORIN <to...@gmail.com> wrote:

> However behavior of some analyzers changed.
>
> So even after upgrade the old index is readable with 4.0, it doesn't mean
> everything still works as before.
>

Thank you Torin, I am using the standard analyzer only and both the systems
use Unicode 4.0 and I don't smell any problems here.

>
> On Tue, Nov 20, 2012 at 12:20 PM, Ian Lea <ia...@gmail.com> wrote:
>
> > You can upgrade the indexes with org.apache.lucene.index.IndexUpgrader.
> >  You'll need to do it in steps, from 2.x to 3.x to 4.x, but should work
> > fine as far as I know.
> >
> >
> > --
> > Ian.
> >
>
Thank you Ian, this is giving me some head starts.

> >
> >
> > On Tue, Nov 20, 2012 at 10:16 AM, Ramprakash Ramamoorthy <
> > youngestachiever@gmail.com> wrote:
> >
> > > I understand lucene 2.x indexes are not compatible with the latest
> > version
> > > of lucene 4.0. However we have all our indexes indexed with lucene 2.3.
> > >
> > > Now that we are planning to migrate to Lucene 4.0, is there any work
> > > around/hack I can do, so that I can still read the 2.3 indices? Or is
> > > forgoing the older indices the only option?
> > >
> > > P.S : Am afraid, Re-indexing is not feasible.
> > >
> > > --
> > > With Thanks and Regards,
> > > Ramprakash Ramamoorthy,
> > > Chennai,
> > > India.
> > >
> >
>



-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
Engineer Trainee,
Zoho Corporation.
+91 9626975420

Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by Trejkaz <tr...@trypticon.org>.
On Wed, Nov 21, 2012 at 12:33 AM, Ramprakash Ramamoorthy
<yo...@gmail.com> wrote:
> On Tue, Nov 20, 2012 at 5:42 PM, Danil ŢORIN <to...@gmail.com> wrote:
>
>> Ironically most of the changes are in unicode handling and standard
>> analyzer ;)
>>
>
> Ouch! It hurts then ;)

What we did going from 2 -> 3 (and in some cases where passing the
right Version into a constructor didn't actually give the same
behaviour as the old version... I'm looking at you, StandardTokenizer)
was to archive copies of the classes from older versions of Lucene and
layer our own backwards-compatible API on top of them. You just have
to come up with a way to identify how something was indexed and
support that forever (e.g. give all the Tokenizer and TokenFilter
implementations unique names and never change the names.)

The only time this really hurts is when Lucene change the API on
something like TokenFilter and you have 20 or so implementations of it
which you now have to update.

It's a good example of how backwards compatibility slows down
development time. The amount of work you have to do each time upstream
changes something is more or less directly proportional to how long
your application has been supported for. If I were making the
decisions, I wouldn't support anything across major versions and you
would just get an export/import tool for each version so you could
bring the data across if you really wanted it.

TX

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


Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by Ramprakash Ramamoorthy <yo...@gmail.com>.
On Tue, Nov 20, 2012 at 5:42 PM, Danil ŢORIN <to...@gmail.com> wrote:

> Ironically most of the changes are in unicode handling and standard
> analyzer ;)
>

Ouch! It hurts then ;)

>
> On Tue, Nov 20, 2012 at 12:31 PM, Ramprakash Ramamoorthy <
> youngestachiever@gmail.com> wrote:
>
> > On Tue, Nov 20, 2012 at 3:54 PM, Danil ŢORIN <to...@gmail.com> wrote:
> >
> > > However behavior of some analyzers changed.
> > >
> > > So even after upgrade the old index is readable with 4.0, it doesn't
> mean
> > > everything still works as before.
> > >
> >
> > Thank you Torin, I am using the standard analyzer only and both the
> systems
> > use Unicode 4.0 and I don't smell any problems here.
> >
> > >
> > > On Tue, Nov 20, 2012 at 12:20 PM, Ian Lea <ia...@gmail.com> wrote:
> > >
> > > > You can upgrade the indexes with
> org.apache.lucene.index.IndexUpgrader.
> > > >  You'll need to do it in steps, from 2.x to 3.x to 4.x, but should
> work
> > > > fine as far as I know.
> > > >
> > > >
> > > > --
> > > > Ian.
> > > >
> > >
> > Thank you Ian, this is giving me some head starts.
> >
> > > >
> > > >
> > > > On Tue, Nov 20, 2012 at 10:16 AM, Ramprakash Ramamoorthy <
> > > > youngestachiever@gmail.com> wrote:
> > > >
> > > > > I understand lucene 2.x indexes are not compatible with the latest
> > > > version
> > > > > of lucene 4.0. However we have all our indexes indexed with lucene
> > 2.3.
> > > > >
> > > > > Now that we are planning to migrate to Lucene 4.0, is there any
> work
> > > > > around/hack I can do, so that I can still read the 2.3 indices? Or
> is
> > > > > forgoing the older indices the only option?
> > > > >
> > > > > P.S : Am afraid, Re-indexing is not feasible.
> > > > >
> > > > > --
> > > > > With Thanks and Regards,
> > > > > Ramprakash Ramamoorthy,
> > > > > Chennai,
> > > > > India.
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > With Thanks and Regards,
> > Ramprakash Ramamoorthy,
> > Engineer Trainee,
> > Zoho Corporation.
> > +91 9626975420
> >
>



-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
Engineer Trainee,
Zoho Corporation.
+91 9626975420

Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by Danil ŢORIN <to...@gmail.com>.
Ironically most of the changes are in unicode handling and standard
analyzer ;)

On Tue, Nov 20, 2012 at 12:31 PM, Ramprakash Ramamoorthy <
youngestachiever@gmail.com> wrote:

> On Tue, Nov 20, 2012 at 3:54 PM, Danil ŢORIN <to...@gmail.com> wrote:
>
> > However behavior of some analyzers changed.
> >
> > So even after upgrade the old index is readable with 4.0, it doesn't mean
> > everything still works as before.
> >
>
> Thank you Torin, I am using the standard analyzer only and both the systems
> use Unicode 4.0 and I don't smell any problems here.
>
> >
> > On Tue, Nov 20, 2012 at 12:20 PM, Ian Lea <ia...@gmail.com> wrote:
> >
> > > You can upgrade the indexes with org.apache.lucene.index.IndexUpgrader.
> > >  You'll need to do it in steps, from 2.x to 3.x to 4.x, but should work
> > > fine as far as I know.
> > >
> > >
> > > --
> > > Ian.
> > >
> >
> Thank you Ian, this is giving me some head starts.
>
> > >
> > >
> > > On Tue, Nov 20, 2012 at 10:16 AM, Ramprakash Ramamoorthy <
> > > youngestachiever@gmail.com> wrote:
> > >
> > > > I understand lucene 2.x indexes are not compatible with the latest
> > > version
> > > > of lucene 4.0. However we have all our indexes indexed with lucene
> 2.3.
> > > >
> > > > Now that we are planning to migrate to Lucene 4.0, is there any work
> > > > around/hack I can do, so that I can still read the 2.3 indices? Or is
> > > > forgoing the older indices the only option?
> > > >
> > > > P.S : Am afraid, Re-indexing is not feasible.
> > > >
> > > > --
> > > > With Thanks and Regards,
> > > > Ramprakash Ramamoorthy,
> > > > Chennai,
> > > > India.
> > > >
> > >
> >
>
>
>
> --
> With Thanks and Regards,
> Ramprakash Ramamoorthy,
> Engineer Trainee,
> Zoho Corporation.
> +91 9626975420
>

Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by Ramprakash Ramamoorthy <yo...@gmail.com>.
On Tue, Nov 20, 2012 at 3:54 PM, Danil ŢORIN <to...@gmail.com> wrote:

> However behavior of some analyzers changed.
>
> So even after upgrade the old index is readable with 4.0, it doesn't mean
> everything still works as before.
>

Thank you Torin, I am using the standard analyzer only and both the systems
use Unicode 4.0 and I don't smell any problems here.

>
> On Tue, Nov 20, 2012 at 12:20 PM, Ian Lea <ia...@gmail.com> wrote:
>
> > You can upgrade the indexes with org.apache.lucene.index.IndexUpgrader.
> >  You'll need to do it in steps, from 2.x to 3.x to 4.x, but should work
> > fine as far as I know.
> >
> >
> > --
> > Ian.
> >
>
Thank you Ian, this is giving me some head starts.

> >
> >
> > On Tue, Nov 20, 2012 at 10:16 AM, Ramprakash Ramamoorthy <
> > youngestachiever@gmail.com> wrote:
> >
> > > I understand lucene 2.x indexes are not compatible with the latest
> > version
> > > of lucene 4.0. However we have all our indexes indexed with lucene 2.3.
> > >
> > > Now that we are planning to migrate to Lucene 4.0, is there any work
> > > around/hack I can do, so that I can still read the 2.3 indices? Or is
> > > forgoing the older indices the only option?
> > >
> > > P.S : Am afraid, Re-indexing is not feasible.
> > >
> > > --
> > > With Thanks and Regards,
> > > Ramprakash Ramamoorthy,
> > > Chennai,
> > > India.
> > >
> >
>



-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
Engineer Trainee,
Zoho Corporation.
+91 9626975420

Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by Danil ŢORIN <to...@gmail.com>.
However behavior of some analyzers changed.

So even after upgrade the old index is readable with 4.0, it doesn't mean
everything still works as before.

On Tue, Nov 20, 2012 at 12:20 PM, Ian Lea <ia...@gmail.com> wrote:

> You can upgrade the indexes with org.apache.lucene.index.IndexUpgrader.
>  You'll need to do it in steps, from 2.x to 3.x to 4.x, but should work
> fine as far as I know.
>
>
> --
> Ian.
>
>
>
> On Tue, Nov 20, 2012 at 10:16 AM, Ramprakash Ramamoorthy <
> youngestachiever@gmail.com> wrote:
>
> > I understand lucene 2.x indexes are not compatible with the latest
> version
> > of lucene 4.0. However we have all our indexes indexed with lucene 2.3.
> >
> > Now that we are planning to migrate to Lucene 4.0, is there any work
> > around/hack I can do, so that I can still read the 2.3 indices? Or is
> > forgoing the older indices the only option?
> >
> > P.S : Am afraid, Re-indexing is not feasible.
> >
> > --
> > With Thanks and Regards,
> > Ramprakash Ramamoorthy,
> > Chennai,
> > India.
> >
>

Re: Using Lucene 2.3 indices with Lucene 4.0

Posted by Ian Lea <ia...@gmail.com>.
You can upgrade the indexes with org.apache.lucene.index.IndexUpgrader.
 You'll need to do it in steps, from 2.x to 3.x to 4.x, but should work
fine as far as I know.


--
Ian.



On Tue, Nov 20, 2012 at 10:16 AM, Ramprakash Ramamoorthy <
youngestachiever@gmail.com> wrote:

> I understand lucene 2.x indexes are not compatible with the latest version
> of lucene 4.0. However we have all our indexes indexed with lucene 2.3.
>
> Now that we are planning to migrate to Lucene 4.0, is there any work
> around/hack I can do, so that I can still read the 2.3 indices? Or is
> forgoing the older indices the only option?
>
> P.S : Am afraid, Re-indexing is not feasible.
>
> --
> With Thanks and Regards,
> Ramprakash Ramamoorthy,
> Chennai,
> India.
>