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 KARTHIK SHIVAKUMAR <ns...@gmail.com> on 2011/12/02 04:54:09 UTC

lucene-core-3.3.0 not optimizing

Hi

Spec
O/s win os 7
Jdk : 1.6.0_29
Lucene  lucene-core-3.3.0



Finally after Indexing successfully ,Why this Code does not optimize (
sample code )

            INDEX_WRITER.optimize(100);
            INDEX_WRITER.commit();
            INDEX_WRITER.close();


*N.S.KARTHIK
R.M.S.COLONY
BEHIND BANK OF INDIA
R.M.V 2ND STAGE
BANGALORE
560094*

Re: lucene-core-3.3.0 not optimizing

Posted by Simon Willnauer <si...@googlemail.com>.
On Fri, Dec 2, 2011 at 12:15 PM, Simon Hafner <ha...@gmail.com> wrote:
>
> On 02.12.2011, at 04:54, KARTHIK SHIVAKUMAR wrote:
>
>> Hi
>>
>> Spec
>> O/s win os 7
>> Jdk : 1.6.0_29
>> Lucene  lucene-core-3.3.0
>>
>> Finally after Indexing successfully ,Why this Code does not optimize (
>> sample code )
>>
>>            INDEX_WRITER.optimize(100);
>>            INDEX_WRITER.commit();
>>            INDEX_WRITER.close();
>
> Because you shouldn't use it [1] in general. :-)

well this is not entirely true. If you have a static index ie. you
build it every week or so optimizing it still makes sense. We renamed
it to something less cool sounding since it does more harm than good
in lots of situations and people shouldn't feel encouraged to use it
just because it has a fancy name. Read the javadoc or one or my last
blogs ( http://bit.ly/vl0Jte ) for more background

simon
>
> Simon
>
> [1‘ https://issues.apache.org/jira/browse/LUCENE-3454
> ---------------------------------------------------------------------
> 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: lucene-core-3.3.0 not optimizing

Posted by Simon Hafner <ha...@gmail.com>.
On 02.12.2011, at 04:54, KARTHIK SHIVAKUMAR wrote:

> Hi
> 
> Spec
> O/s win os 7
> Jdk : 1.6.0_29
> Lucene  lucene-core-3.3.0
> 
> Finally after Indexing successfully ,Why this Code does not optimize (
> sample code )
> 
>            INDEX_WRITER.optimize(100);
>            INDEX_WRITER.commit();
>            INDEX_WRITER.close();

Because you shouldn't use it [1] in general. :-)

Simon

[1‘ https://issues.apache.org/jira/browse/LUCENE-3454
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: lucene-core-3.3.0 not optimizing

Posted by Erick Erickson <er...@gmail.com>.
Try taking a look at the patch, but on a quick glance it doesn't
look like the underlying code has changed much.

But note the whole point of this is that optimize is overused
given its former name, why do you want to keep using it?

Best
Erick

On Tue, Dec 6, 2011 at 1:04 AM, KARTHIK SHIVAKUMAR
<ns...@gmail.com> wrote:
> Hi
>
>>>LUCENE-3454 <http://issues.apache.org/jira/browse/LUCENE-3454>:
>
> So u mean the code has changed with this API ...
>
> Does any body have any sample code snippet ....  or is there a sample to
> play around....
>
>
> with regards
> karthik
>
>
> On Fri, Dec 2, 2011 at 3:44 PM, Ian Lea <ia...@gmail.com> wrote:
>
>> Well, calling optimize(maxNumSegments) will (from the javadocs on
>> recent releases) "Optimize the index down to <= maxNumSegments".  So
>> optimize(100) won't get you down to 1 big file, unless you are using
>> compound files perhaps.  Maybe it did something different 7 years ago
>> but that seems very unlikely.
>>
>> In 3.5.0 all optimize() calls are deprecated anyway.  I suggest you
>> read the release notes and the javadocs, upgrade to 3.5.0 and remove
>> all optimize() calls altogether.
>>
>>
>> --
>> Ian.
>>
>>
>> On Fri, Dec 2, 2011 at 9:58 AM, KARTHIK SHIVAKUMAR
>> <ns...@gmail.com> wrote:
>> > Hi
>> >
>> > I have used Index and Optimize   5+ Million XML docs  in Lucene 1.x    7
>> > years ago,
>> >
>> > And this piece of IndexWriter.optimize used to Merger all the bits and
>> > pieces of the created into 1 big file.
>> >
>> > I have not tracked the API changes since 7 years....and with
>> > lucene-core-3.3.0 ...on google  not able to  find the solutions Why this
>> is
>> > happening.
>> >
>> >
>> > with regards
>> > karthik
>> >
>> > On Fri, Dec 2, 2011 at 12:37 PM, Simon Willnauer <
>> > simon.willnauer@googlemail.com> wrote:
>> >
>> >> what do you understand when you say optimize? Unless you tell us what
>> >> this code does in your case and what you'd expect it doing its
>> >> impossible to give you any reasonable answer.
>> >>
>> >> simon
>> >>
>> >> On Fri, Dec 2, 2011 at 4:54 AM, KARTHIK SHIVAKUMAR
>> >> <ns...@gmail.com> wrote:
>> >> > Hi
>> >> >
>> >> > Spec
>> >> > O/s win os 7
>> >> > Jdk : 1.6.0_29
>> >> > Lucene  lucene-core-3.3.0
>> >> >
>> >> >
>> >> >
>> >> > Finally after Indexing successfully ,Why this Code does not optimize (
>> >> > sample code )
>> >> >
>> >> >            INDEX_WRITER.optimize(100);
>> >> >            INDEX_WRITER.commit();
>> >> >            INDEX_WRITER.close();
>> >> >
>> >> >
>> >> > *N.S.KARTHIK
>> >> > R.M.S.COLONY
>> >> > BEHIND BANK OF INDIA
>> >> > R.M.V 2ND STAGE
>> >> > BANGALORE
>> >> > 560094*
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> >> For additional commands, e-mail: java-user-help@lucene.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > *N.S.KARTHIK
>> > R.M.S.COLONY
>> > BEHIND BANK OF INDIA
>> > R.M.V 2ND STAGE
>> > BANGALORE
>> > 560094*
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
>
> --
> *N.S.KARTHIK
> R.M.S.COLONY
> BEHIND BANK OF INDIA
> R.M.V 2ND STAGE
> BANGALORE
> 560094*

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


Re: lucene-core-3.3.0 not optimizing

Posted by KARTHIK SHIVAKUMAR <ns...@gmail.com>.
Hi

>>LUCENE-3454 <http://issues.apache.org/jira/browse/LUCENE-3454>:

So u mean the code has changed with this API ...

Does any body have any sample code snippet ....  or is there a sample to
play around....


with regards
karthik


On Fri, Dec 2, 2011 at 3:44 PM, Ian Lea <ia...@gmail.com> wrote:

> Well, calling optimize(maxNumSegments) will (from the javadocs on
> recent releases) "Optimize the index down to <= maxNumSegments".  So
> optimize(100) won't get you down to 1 big file, unless you are using
> compound files perhaps.  Maybe it did something different 7 years ago
> but that seems very unlikely.
>
> In 3.5.0 all optimize() calls are deprecated anyway.  I suggest you
> read the release notes and the javadocs, upgrade to 3.5.0 and remove
> all optimize() calls altogether.
>
>
> --
> Ian.
>
>
> On Fri, Dec 2, 2011 at 9:58 AM, KARTHIK SHIVAKUMAR
> <ns...@gmail.com> wrote:
> > Hi
> >
> > I have used Index and Optimize   5+ Million XML docs  in Lucene 1.x    7
> > years ago,
> >
> > And this piece of IndexWriter.optimize used to Merger all the bits and
> > pieces of the created into 1 big file.
> >
> > I have not tracked the API changes since 7 years....and with
> > lucene-core-3.3.0 ...on google  not able to  find the solutions Why this
> is
> > happening.
> >
> >
> > with regards
> > karthik
> >
> > On Fri, Dec 2, 2011 at 12:37 PM, Simon Willnauer <
> > simon.willnauer@googlemail.com> wrote:
> >
> >> what do you understand when you say optimize? Unless you tell us what
> >> this code does in your case and what you'd expect it doing its
> >> impossible to give you any reasonable answer.
> >>
> >> simon
> >>
> >> On Fri, Dec 2, 2011 at 4:54 AM, KARTHIK SHIVAKUMAR
> >> <ns...@gmail.com> wrote:
> >> > Hi
> >> >
> >> > Spec
> >> > O/s win os 7
> >> > Jdk : 1.6.0_29
> >> > Lucene  lucene-core-3.3.0
> >> >
> >> >
> >> >
> >> > Finally after Indexing successfully ,Why this Code does not optimize (
> >> > sample code )
> >> >
> >> >            INDEX_WRITER.optimize(100);
> >> >            INDEX_WRITER.commit();
> >> >            INDEX_WRITER.close();
> >> >
> >> >
> >> > *N.S.KARTHIK
> >> > R.M.S.COLONY
> >> > BEHIND BANK OF INDIA
> >> > R.M.V 2ND STAGE
> >> > BANGALORE
> >> > 560094*
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> >
> >
> > --
> > *N.S.KARTHIK
> > R.M.S.COLONY
> > BEHIND BANK OF INDIA
> > R.M.V 2ND STAGE
> > BANGALORE
> > 560094*
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
*N.S.KARTHIK
R.M.S.COLONY
BEHIND BANK OF INDIA
R.M.V 2ND STAGE
BANGALORE
560094*

Re: lucene-core-3.3.0 not optimizing

Posted by Ian Lea <ia...@gmail.com>.
Well, calling optimize(maxNumSegments) will (from the javadocs on
recent releases) "Optimize the index down to <= maxNumSegments".  So
optimize(100) won't get you down to 1 big file, unless you are using
compound files perhaps.  Maybe it did something different 7 years ago
but that seems very unlikely.

In 3.5.0 all optimize() calls are deprecated anyway.  I suggest you
read the release notes and the javadocs, upgrade to 3.5.0 and remove
all optimize() calls altogether.


--
Ian.


On Fri, Dec 2, 2011 at 9:58 AM, KARTHIK SHIVAKUMAR
<ns...@gmail.com> wrote:
> Hi
>
> I have used Index and Optimize   5+ Million XML docs  in Lucene 1.x    7
> years ago,
>
> And this piece of IndexWriter.optimize used to Merger all the bits and
> pieces of the created into 1 big file.
>
> I have not tracked the API changes since 7 years....and with
> lucene-core-3.3.0 ...on google  not able to  find the solutions Why this is
> happening.
>
>
> with regards
> karthik
>
> On Fri, Dec 2, 2011 at 12:37 PM, Simon Willnauer <
> simon.willnauer@googlemail.com> wrote:
>
>> what do you understand when you say optimize? Unless you tell us what
>> this code does in your case and what you'd expect it doing its
>> impossible to give you any reasonable answer.
>>
>> simon
>>
>> On Fri, Dec 2, 2011 at 4:54 AM, KARTHIK SHIVAKUMAR
>> <ns...@gmail.com> wrote:
>> > Hi
>> >
>> > Spec
>> > O/s win os 7
>> > Jdk : 1.6.0_29
>> > Lucene  lucene-core-3.3.0
>> >
>> >
>> >
>> > Finally after Indexing successfully ,Why this Code does not optimize (
>> > sample code )
>> >
>> >            INDEX_WRITER.optimize(100);
>> >            INDEX_WRITER.commit();
>> >            INDEX_WRITER.close();
>> >
>> >
>> > *N.S.KARTHIK
>> > R.M.S.COLONY
>> > BEHIND BANK OF INDIA
>> > R.M.V 2ND STAGE
>> > BANGALORE
>> > 560094*
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>
>
> --
> *N.S.KARTHIK
> R.M.S.COLONY
> BEHIND BANK OF INDIA
> R.M.V 2ND STAGE
> BANGALORE
> 560094*

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


Re: lucene-core-3.3.0 not optimizing

Posted by KARTHIK SHIVAKUMAR <ns...@gmail.com>.
Hi

I have used Index and Optimize   5+ Million XML docs  in Lucene 1.x    7
years ago,

And this piece of IndexWriter.optimize used to Merger all the bits and
pieces of the created into 1 big file.

I have not tracked the API changes since 7 years....and with
lucene-core-3.3.0 ...on google  not able to  find the solutions Why this is
happening.


with regards
karthik

On Fri, Dec 2, 2011 at 12:37 PM, Simon Willnauer <
simon.willnauer@googlemail.com> wrote:

> what do you understand when you say optimize? Unless you tell us what
> this code does in your case and what you'd expect it doing its
> impossible to give you any reasonable answer.
>
> simon
>
> On Fri, Dec 2, 2011 at 4:54 AM, KARTHIK SHIVAKUMAR
> <ns...@gmail.com> wrote:
> > Hi
> >
> > Spec
> > O/s win os 7
> > Jdk : 1.6.0_29
> > Lucene  lucene-core-3.3.0
> >
> >
> >
> > Finally after Indexing successfully ,Why this Code does not optimize (
> > sample code )
> >
> >            INDEX_WRITER.optimize(100);
> >            INDEX_WRITER.commit();
> >            INDEX_WRITER.close();
> >
> >
> > *N.S.KARTHIK
> > R.M.S.COLONY
> > BEHIND BANK OF INDIA
> > R.M.V 2ND STAGE
> > BANGALORE
> > 560094*
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
*N.S.KARTHIK
R.M.S.COLONY
BEHIND BANK OF INDIA
R.M.V 2ND STAGE
BANGALORE
560094*

Re: lucene-core-3.3.0 not optimizing

Posted by Simon Willnauer <si...@googlemail.com>.
what do you understand when you say optimize? Unless you tell us what
this code does in your case and what you'd expect it doing its
impossible to give you any reasonable answer.

simon

On Fri, Dec 2, 2011 at 4:54 AM, KARTHIK SHIVAKUMAR
<ns...@gmail.com> wrote:
> Hi
>
> Spec
> O/s win os 7
> Jdk : 1.6.0_29
> Lucene  lucene-core-3.3.0
>
>
>
> Finally after Indexing successfully ,Why this Code does not optimize (
> sample code )
>
>            INDEX_WRITER.optimize(100);
>            INDEX_WRITER.commit();
>            INDEX_WRITER.close();
>
>
> *N.S.KARTHIK
> R.M.S.COLONY
> BEHIND BANK OF INDIA
> R.M.V 2ND STAGE
> BANGALORE
> 560094*

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