Thanks Digy.  This fixed the Optimize() call.

I checked in the change.

-- George 

> -----Original Message-----
> From: Digy [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, May 02, 2007 2:22 PM
> To: [email protected]
> Subject: RE: Apache Lucene.Net 2.1 build 001 "early-Alpha" is released
> 
>       Hi George,
> 
>       If you don't mind, i want to send my first patch as a text file.
> 
>       DIGY
> 
>       
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> +-+-+-+-+-
>       
>       To be able to run the my simple sample code, I changed 
> the "Clone"
> method of "SegmentInfos" class
>       as below
>       
>       //-ORG. CODE    
>               public override System.Object Clone()
>               {
>                       SegmentInfos sis = (SegmentInfos) base.Clone();
>                       for (int i = 0; i < sis.Count; i++)
>                       {
>                               sis[i] = ((SegmentInfo) sis[i]).Clone();
>                       }
>                       return sis;
>               }
> 
>       //+NEW CODE     
>               public override System.Object Clone()
>               {
>                   SegmentInfos sis = new SegmentInfos();
>                       for (int i = 0; i < this.Count; i++)
>                       {
>                               sis.Add(((SegmentInfo)this[i]).Clone());
>                       }
>                       return sis;
>               }
> 
> 
>       //SAMPLE CODE
>       private void button1_Click(object sender, EventArgs e)
>         {
>             string IndexPath = "IndexAAA";
>             IndexWriter wr = new IndexWriter(IndexPath, new 
> Lucene.Net.Analysis.Standard.StandardAnalyzer(), true);
>             DummyIndex(wr);
>             wr.Close();
>             
>             rtf1.Text = "Indexing Completed\n";
>             Application.DoEvents();
> 
> 
>             IndexSearcher s = new IndexSearcher(IndexPath);
>             QueryParser parser = new QueryParser("Field1", 
> new Lucene.Net.Analysis.Standard.StandardAnalyzer());
>             Query q = parser.Parse("2*");
>             Hits hits = s.Search(q);
>             rtf1.Text = hits.Length().ToString() + " hits found";
>         }
> 
>         void DummyIndex(IndexWriter wr)
>         {
> 
>             for (int i = 0; i < 1000; i++)
>             {
>                 Document doc = new Document();
>                 
>                 Field f = new Field("Field1", i.ToString() , 
> Field.Store.YES, Field.Index.TOKENIZED);
>                 doc.Add(f);
>                 wr.AddDocument(doc);
>             }
> 
>             wr.Optimize();
>         }
> 
> 
> 
> 
> -----Original Message-----
> From: George Aroush [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 02, 2007 3:43 AM
> To: [EMAIL PROTECTED];
> [email protected]
> Subject: RE: Apache Lucene.Net 2.1 build 001 "early-Alpha" is released
> 
> Hi Everyone,
> 
> Two other things:
> 
> 1) Beside the exception during optimization, there are a 
> number of porting questions that I have.  Just search for the 
> text "Aroush-2.1" and you will find them.  Beside those, 
> there are left over porting questions, so it's best if you 
> search for "Aroush".
> 
> 2) Any fix that you provide, should be targeted at fixing the 
> port and no more.  That is, lets hold off any .NET 2.0 
> related changes till when we get this release working.
> 
> Regards,
> 
> -- George
> 
> > -----Original Message-----
> > From: George Aroush [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, May 01, 2007 3:01 PM
> > To: [email protected];
> > [EMAIL PROTECTED]
> > Subject: Apache Lucene.Net 2.1 build 001 "early-Alpha" is released
> > 
> > Hi Everyone,
> > 
> > I just finished checking in what is a first cut at Apache 
> Lucene.Net 
> > 2.1 release.  This is as a result of porting Java Lucene 2.1 to 
> > Lucene.Net.
> > 
> > This release is a work in progress and here is a brief high level 
> > summary of
> > it:
> > 
> >     - Dev Release:  Apache Lucene.Net.2.1 build 001 "early-Alpha"
> >     - Issues: Optimizing an index will cause an exception.
> >     - Issues: The "Test" code has not yet be ported for 
> this release.
> >     - Issues: Code in "contrib" have not been validated to 
> work with this 
> > release.
> > 
> > While I work on porting the "Test" code from Java Lucene to 
> > Lucene.Net, please take a look at this release, test it, 
> report issues 
> > and most of all submit fixes in form of patches.  For 
> starters, index 
> > optimization is causing an exception.  Anyone who can look at this 
> > issue is greatly appreciated.
> > 
> > Regards,
> > 
> > -- George Aroush
> > 
> 

Reply via email to