You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Digy (JIRA)" <ji...@apache.org> on 2011/04/23 15:55:05 UTC

[Lucene.Net] [jira] [Created] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Replacing ArrayLists, Hashtables etc. with appropriate Generics.
----------------------------------------------------------------

                 Key: LUCENENET-412
                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
             Project: Lucene.Net
          Issue Type: Improvement
    Affects Versions: Lucene.Net 2.9.4
            Reporter: Digy
            Priority: Minor
             Fix For: Lucene.Net 2.9.4


This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by digy digy <di...@gmail.com>.
just aesthetical reasons. See the java code

      cache = new FilterCache<DocIdSet>(deletesMode) {
      @Override
      public DocIdSet mergeDeletes(final IndexReader r, final DocIdSet
docIdSet) {
        return new FilteredDocIdSet(docIdSet) {
          @Override
          protected boolean match(int docID) {
            return !r.isDeleted(docID);
          }
        };
      }
    };

DIGY

On Wed, May 18, 2011 at 2:14 AM, Rory Plaire <co...@gmail.com> wrote:

> This is a great improvement, but why not also remove the braces and
> returns?
>
>
> var cache = new FilterCache<DocIdSet>(deletesMode,
>  (reader, docIdSet) => new FilteredDocIdSet(
>   (DocIdSet)docIdSet, docid => !reader.IsDeleted(docid)));
>
>
> On Tue, May 17, 2011 at 3:01 PM, Digy (JIRA) <ji...@apache.org> wrote:
>
> >
> >    [
> >
> https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035092#comment-13035092
> ]
> >
> > Digy commented on LUCENENET-412:
> > --------------------------------
> >
> > One more sample
> > {code}
> > From:
> >        class AnonymousFilterCache : FilterCache
> >        {
> >                class AnonymousFilteredDocIdSet : FilteredDocIdSet
> >                {
> >                        IndexReader r;
> >                        public AnonymousFilteredDocIdSet(DocIdSet
> innerSet,
> > IndexReader r) : base(innerSet)
> >                        {
> >                                this.r = r;
> >                        }
> >                        public override bool Match(int docid)
> >                        {
> >                                return !r.IsDeleted(docid);
> >                        }
> >                }
> >
> >                public AnonymousFilterCache(DeletesMode deletesMode) :
> > base(deletesMode)
> >                {
> >                }
> >
> >                protected  override object MergeDeletes(IndexReader
> reader,
> > object docIdSet)
> >                {
> >                        return new
> > AnonymousFilteredDocIdSet((DocIdSet)docIdSet, reader);
> >                }
> >        }
> >        .......
> >        cache = new AnonymousFilterCache(deletesMode);
> >
> >
> >
> > To:
> >        cache = new FilterCache<DocIdSet>(deletesMode,
> >                (reader,docIdSet)=>{
> >                        return new FilteredDocIdSet((DocIdSet)docIdSet,
> >                        (docid) =>
> >                        {
> >                                return !reader.IsDeleted(docid);
> >                        });
> >                 });
> > {code}
> >
> > DIGY
> >
> > > Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> > > ----------------------------------------------------------------
> > >
> > >                 Key: LUCENENET-412
> > >                 URL:
> https://issues.apache.org/jira/browse/LUCENENET-412
> > >             Project: Lucene.Net
> > >          Issue Type: Improvement
> > >    Affects Versions: Lucene.Net 2.9.4
> > >            Reporter: Digy
> > >            Priority: Minor
> > >             Fix For: Lucene.Net 2.9.4
> > >
> > >         Attachments: IEquatable for Query&Subclasses.patch,
> > LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
> > >
> > >
> > > This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some
> > performance gains.
> >
> > --
> > This message is automatically generated by JIRA.
> > For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> >
>

Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by Rory Plaire <co...@gmail.com>.
This is a great improvement, but why not also remove the braces and returns?


var cache = new FilterCache<DocIdSet>(deletesMode,
  (reader, docIdSet) => new FilteredDocIdSet(
   (DocIdSet)docIdSet, docid => !reader.IsDeleted(docid)));


On Tue, May 17, 2011 at 3:01 PM, Digy (JIRA) <ji...@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035092#comment-13035092]
>
> Digy commented on LUCENENET-412:
> --------------------------------
>
> One more sample
> {code}
> From:
>        class AnonymousFilterCache : FilterCache
>        {
>                class AnonymousFilteredDocIdSet : FilteredDocIdSet
>                {
>                        IndexReader r;
>                        public AnonymousFilteredDocIdSet(DocIdSet innerSet,
> IndexReader r) : base(innerSet)
>                        {
>                                this.r = r;
>                        }
>                        public override bool Match(int docid)
>                        {
>                                return !r.IsDeleted(docid);
>                        }
>                }
>
>                public AnonymousFilterCache(DeletesMode deletesMode) :
> base(deletesMode)
>                {
>                }
>
>                protected  override object MergeDeletes(IndexReader reader,
> object docIdSet)
>                {
>                        return new
> AnonymousFilteredDocIdSet((DocIdSet)docIdSet, reader);
>                }
>        }
>        .......
>        cache = new AnonymousFilterCache(deletesMode);
>
>
>
> To:
>        cache = new FilterCache<DocIdSet>(deletesMode,
>                (reader,docIdSet)=>{
>                        return new FilteredDocIdSet((DocIdSet)docIdSet,
>                        (docid) =>
>                        {
>                                return !reader.IsDeleted(docid);
>                        });
>                 });
> {code}
>
> DIGY
>
> > Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> > ----------------------------------------------------------------
> >
> >                 Key: LUCENENET-412
> >                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
> >             Project: Lucene.Net
> >          Issue Type: Improvement
> >    Affects Versions: Lucene.Net 2.9.4
> >            Reporter: Digy
> >            Priority: Minor
> >             Fix For: Lucene.Net 2.9.4
> >
> >         Attachments: IEquatable for Query&Subclasses.patch,
> LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
> >
> >
> > This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some
> performance gains.
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>

Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by digy digy <di...@gmail.com>.
On Fri, May 20, 2011 at 12:34 PM, Andy Pook <an...@gmail.com> wrote:

> It'd be useful if There was a StopAnalyzer ctor overload that took an
> IEnumerable<string> and maybe the current one that takes List<string>
> should
> be ICollection<string> (same as internal stopWords member).
> Just gives a little flexibility on the types that can be used.
>
>
I changed List<string> to ICollection<string>


> Also there is a little confusion around the treatment of the various
> collection types. i.e. string[] gets converted to  a CharArraySet. Why not
> just a List<string> ?
>

So is it in lucene.java


>
> Thoughts?
>
> Cheers,
>  Andy
>

DIGY


>
> On 18 May 2011 23:20, Digy (JIRA) <ji...@apache.org> wrote:
>
> >
> >    [
> >
> https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035795#comment-13035795
> ]
> >
> > Digy commented on LUCENENET-412:
> > --------------------------------
> >
> > Hi All,
> >
> > Lucene.Net 2.9.4g is almost ready for testing & feedbacks.
> >
> > While injecting generics & making some clean up in code, I tried to be
> > close to lucene 3.0.3 as much as possible.
> > Therefore it's position is somewhere between lucene.Java 2.9.4 & 3.0.3
> >
> > DIGY
> >
> >
> > PS: For those who might want to try this version:
> > It won't probably be a drop-in replacement since there are a few API
> > changes like
> > - StopAnalyzer(List<string> stopWords)
> > - Query.ExtractTerms(ICollection<string>)
> > - TopDocs.*TotalHits*, TopDocs.*ScoreDocs*
> > and some removed methods/classes like
> > - Filter.Bits
> > - JustCompileSearch
> > - Contrib/Similarity.Net
> >
> >
> >
> >
> > > Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> > > ----------------------------------------------------------------
> > >
> > >                 Key: LUCENENET-412
> > >                 URL:
> https://issues.apache.org/jira/browse/LUCENENET-412
> > >             Project: Lucene.Net
> > >          Issue Type: Improvement
> > >    Affects Versions: Lucene.Net 2.9.4
> > >            Reporter: Digy
> > >            Priority: Minor
> > >             Fix For: Lucene.Net 2.9.4
> > >
> > >         Attachments: IEquatable for Query&Subclasses.patch,
> > LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
> > >
> > >
> > > This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some
> > performance gains.
> >
> > --
> > This message is automatically generated by JIRA.
> > For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> >
>

Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by Andy Pook <an...@gmail.com>.
It'd be useful if There was a StopAnalyzer ctor overload that took an
IEnumerable<string> and maybe the current one that takes List<string> should
be ICollection<string> (same as internal stopWords member).
Just gives a little flexibility on the types that can be used.

Also there is a little confusion around the treatment of the various
collection types. i.e. string[] gets converted to  a CharArraySet. Why not
just a List<string> ?

Thoughts?

Cheers,
  Andy

On 18 May 2011 23:20, Digy (JIRA) <ji...@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035795#comment-13035795]
>
> Digy commented on LUCENENET-412:
> --------------------------------
>
> Hi All,
>
> Lucene.Net 2.9.4g is almost ready for testing & feedbacks.
>
> While injecting generics & making some clean up in code, I tried to be
> close to lucene 3.0.3 as much as possible.
> Therefore it's position is somewhere between lucene.Java 2.9.4 & 3.0.3
>
> DIGY
>
>
> PS: For those who might want to try this version:
> It won't probably be a drop-in replacement since there are a few API
> changes like
> - StopAnalyzer(List<string> stopWords)
> - Query.ExtractTerms(ICollection<string>)
> - TopDocs.*TotalHits*, TopDocs.*ScoreDocs*
> and some removed methods/classes like
> - Filter.Bits
> - JustCompileSearch
> - Contrib/Similarity.Net
>
>
>
>
> > Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> > ----------------------------------------------------------------
> >
> >                 Key: LUCENENET-412
> >                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
> >             Project: Lucene.Net
> >          Issue Type: Improvement
> >    Affects Versions: Lucene.Net 2.9.4
> >            Reporter: Digy
> >            Priority: Minor
> >             Fix For: Lucene.Net 2.9.4
> >
> >         Attachments: IEquatable for Query&Subclasses.patch,
> LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
> >
> >
> > This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some
> performance gains.
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>

RE: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by Digy <di...@gmail.com>.
Sorry no binary. As far as I know it requires an official release
DIGY

-----Original Message-----
From: Wyatt Barnett [mailto:wyatt.barnett@gmail.com] 
Sent: Thursday, May 19, 2011 1:45 AM
To: lucene-net-dev@lucene.apache.org
Subject: Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing
ArrayLists, Hashtables etc. with appropriate Generics.

Sweet. Is there a binary I can drop in or should I compile my own?

On Wed, May 18, 2011 at 6:20 PM, Digy (JIRA) <ji...@apache.org> wrote:
>
>    [
https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.
plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035795#comm
ent-13035795 ]
>
> Digy commented on LUCENENET-412:
> --------------------------------
>
> Hi All,
>
> Lucene.Net 2.9.4g is almost ready for testing & feedbacks.
>
> While injecting generics & making some clean up in code, I tried to be
close to lucene 3.0.3 as much as possible.
> Therefore it's position is somewhere between lucene.Java 2.9.4 & 3.0.3
>
> DIGY
>
>
> PS: For those who might want to try this version:
> It won't probably be a drop-in replacement since there are a few API
changes like
> - StopAnalyzer(List<string> stopWords)
> - Query.ExtractTerms(ICollection<string>)
> - TopDocs.*TotalHits*, TopDocs.*ScoreDocs*
> and some removed methods/classes like
> - Filter.Bits
> - JustCompileSearch
> - Contrib/Similarity.Net
>
>
>
>
>> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
>> ----------------------------------------------------------------
>>
>>                 Key: LUCENENET-412
>>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>>             Project: Lucene.Net
>>          Issue Type: Improvement
>>    Affects Versions: Lucene.Net 2.9.4
>>            Reporter: Digy
>>            Priority: Minor
>>             Fix For: Lucene.Net 2.9.4
>>
>>         Attachments: IEquatable for Query&Subclasses.patch,
LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>>
>>
>> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some
performance gains.
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>


Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by Wyatt Barnett <wy...@gmail.com>.
Sweet. Is there a binary I can drop in or should I compile my own?

On Wed, May 18, 2011 at 6:20 PM, Digy (JIRA) <ji...@apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035795#comment-13035795 ]
>
> Digy commented on LUCENENET-412:
> --------------------------------
>
> Hi All,
>
> Lucene.Net 2.9.4g is almost ready for testing & feedbacks.
>
> While injecting generics & making some clean up in code, I tried to be close to lucene 3.0.3 as much as possible.
> Therefore it's position is somewhere between lucene.Java 2.9.4 & 3.0.3
>
> DIGY
>
>
> PS: For those who might want to try this version:
> It won't probably be a drop-in replacement since there are a few API changes like
> - StopAnalyzer(List<string> stopWords)
> - Query.ExtractTerms(ICollection<string>)
> - TopDocs.*TotalHits*, TopDocs.*ScoreDocs*
> and some removed methods/classes like
> - Filter.Bits
> - JustCompileSearch
> - Contrib/Similarity.Net
>
>
>
>
>> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
>> ----------------------------------------------------------------
>>
>>                 Key: LUCENENET-412
>>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>>             Project: Lucene.Net
>>          Issue Type: Improvement
>>    Affects Versions: Lucene.Net 2.9.4
>>            Reporter: Digy
>>            Priority: Minor
>>             Fix For: Lucene.Net 2.9.4
>>
>>         Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>>
>>
>> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>

Re: [Lucene.Net] [jira] [Resolved] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by Rory Plaire <co...@gmail.com>.
What about https://issues.apache.org/jira/browse/LUCENENET-434?

-r

On Thu, Dec 22, 2011 at 2:47 PM, Digy (Resolved) (JIRA) <ji...@apache.org>wrote:

>
> 2.9.4g is ready to go
> DIGY
>

[Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025204#comment-13025204 ] 

Digy commented on LUCENENET-412:
--------------------------------

Hi All,
I prepared a primitive test case where 6 different words are searched in a loop. 
index size:(670MB, 660,000 docs).

Search speed seems to be more than doubled (although it is hard to count on these results, this indicates, at least, a performance improvement).

Altough Lucene.Net.2.9.4g is far from being ready, It's worth a shot. 

PS: I always run unit tests before comitting. So, the branch is ready to download anytime.

DIGY


> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: LUCENENET-412.patch
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13033235#comment-13033235 ] 

Digy commented on LUCENENET-412:
--------------------------------

Some samples to show the diffs of 2.9.4 & 2.9.4g on Readability.
{code}
From:
	((System.Collections.IList) ((System.Collections.ArrayList) segmentInfos).GetRange(start, start + merge.segments.Count - start)).Clear();
To:
	segmentInfos.RemoveRange(start, start + merge.segments.Count - start);

---------------------------------------------------------------------------------------------------------
From:
	System.Collections.IEnumerator it = ((System.Collections.ICollection) readerToFields[reader]).GetEnumerator();
	while (it.MoveNext())
	{
		if (fieldSelector.Accept((System.String) it.Current) != FieldSelectorResult.NO_LOAD)
		{
			include = true;
			break;
		}
	}
To:
	foreach (string x in readerToFields[reader])
	{
		if (fieldSelector.Accept(x) != FieldSelectorResult.NO_LOAD)
		{
			include = true;
			break;
		}
	}
		
---------------------------------------------------------------------------------------------------------
From:
	for (System.Collections.IEnumerator iter = weights.GetEnumerator(); iter.MoveNext(); )
	{
		((Weight) iter.Current).Normalize(norm);
	}
To:
	foreach(Weight w in weights)
	{
		w.Normalize(norm);
	}

---------------------------------------------------------------------------------------------------------
From:	
	public virtual System.Collections.IList GetTermArrays()
	{
		return (System.Collections.IList) System.Collections.ArrayList.ReadOnly(new System.Collections.ArrayList(termArrays));
	}
To:
	public virtual List<Term[]> GetTermArrays()
	{
		return new List<Term[]>(termArrays);
	}

---------------------------------------------------------------------------------------------------------
From:	
	System.Collections.ArrayList results = new System.Collections.ArrayList();
	....
	return (TermFreqVector[]) results.ToArray(typeof(TermFreqVector));
To:
	 List<TermFreqVector> results = new List<TermFreqVector>();
	 ...
	 return results.ToArray();
	
{code}

DIGY

> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

RE: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by Digy <di...@gmail.com>.
Not just this version, Lucene.Net 2.9.4 also can read (in theory) the index created in 3.0.3. But I haven't tested it myself.
DIGY.

-----Original Message-----
From: Alexander Bauer [mailto:alex@familie-bauer.info] 
Sent: Thursday, May 19, 2011 8:37 AM
To: lucene-net-dev@lucene.apache.org
Subject: Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.


Can i use this version with an existing index based on lucene.Java 3.0.3 ?

Alex


Am 19.05.2011 00:20, schrieb Digy (JIRA):
>      [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035795#comment-13035795 ]
>
> Digy commented on LUCENENET-412:
> --------------------------------
>
> Hi All,
>
> Lucene.Net 2.9.4g is almost ready for testing&  feedbacks.
>
> While injecting generics&  making some clean up in code, I tried to be close to lucene 3.0.3 as much as possible.
> Therefore it's position is somewhere between lucene.Java 2.9.4&  3.0.3
>
> DIGY
>
>
> PS: For those who might want to try this version:
> It won't probably be a drop-in replacement since there are a few API changes like
> - StopAnalyzer(List<string>  stopWords)
> - Query.ExtractTerms(ICollection<string>)
> - TopDocs.*TotalHits*, TopDocs.*ScoreDocs*
> and some removed methods/classes like
> - Filter.Bits
> - JustCompileSearch
> - Contrib/Similarity.Net
>
>
>
>
>> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
>> ----------------------------------------------------------------
>>
>>                  Key: LUCENENET-412
>>                  URL: https://issues.apache.org/jira/browse/LUCENENET-412
>>              Project: Lucene.Net
>>           Issue Type: Improvement
>>     Affects Versions: Lucene.Net 2.9.4
>>             Reporter: Digy
>>             Priority: Minor
>>              Fix For: Lucene.Net 2.9.4
>>
>>          Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>>
>>
>> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>


Re: [Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by Alexander Bauer <al...@familie-bauer.info>.
Can i use this version with an existing index based on lucene.Java 3.0.3 ?

Alex


Am 19.05.2011 00:20, schrieb Digy (JIRA):
>      [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035795#comment-13035795 ]
>
> Digy commented on LUCENENET-412:
> --------------------------------
>
> Hi All,
>
> Lucene.Net 2.9.4g is almost ready for testing&  feedbacks.
>
> While injecting generics&  making some clean up in code, I tried to be close to lucene 3.0.3 as much as possible.
> Therefore it's position is somewhere between lucene.Java 2.9.4&  3.0.3
>
> DIGY
>
>
> PS: For those who might want to try this version:
> It won't probably be a drop-in replacement since there are a few API changes like
> - StopAnalyzer(List<string>  stopWords)
> - Query.ExtractTerms(ICollection<string>)
> - TopDocs.*TotalHits*, TopDocs.*ScoreDocs*
> and some removed methods/classes like
> - Filter.Bits
> - JustCompileSearch
> - Contrib/Similarity.Net
>
>
>
>
>> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
>> ----------------------------------------------------------------
>>
>>                  Key: LUCENENET-412
>>                  URL: https://issues.apache.org/jira/browse/LUCENENET-412
>>              Project: Lucene.Net
>>           Issue Type: Improvement
>>     Affects Versions: Lucene.Net 2.9.4
>>             Reporter: Digy
>>             Priority: Minor
>>              Fix For: Lucene.Net 2.9.4
>>
>>          Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>>
>>
>> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>


[Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035795#comment-13035795 ] 

Digy commented on LUCENENET-412:
--------------------------------

Hi All,

Lucene.Net 2.9.4g is almost ready for testing & feedbacks. 

While injecting generics & making some clean up in code, I tried to be close to lucene 3.0.3 as much as possible.
Therefore it's position is somewhere between lucene.Java 2.9.4 & 3.0.3

DIGY


PS: For those who might want to try this version:
It won't probably be a drop-in replacement since there are a few API changes like
- StopAnalyzer(List<string> stopWords)
- Query.ExtractTerms(ICollection<string>)
- TopDocs.*TotalHits*, TopDocs.*ScoreDocs*
and some removed methods/classes like
- Filter.Bits
- JustCompileSearch
- Contrib/Similarity.Net




> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[Lucene.Net] [jira] [Resolved] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy resolved LUCENENET-412.
----------------------------

    Resolution: Fixed

2.9.4g is ready to go
DIGY
                
> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4g
>
>         Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13024820#comment-13024820 ] 

Digy commented on LUCENENET-412:
--------------------------------

I will continue this work on a different branch
https://svn.apache.org/repos/asf/incubator/lucene.net/branches/Lucene.Net_2_9_4g

DIGY

> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: LUCENENET-412.patch
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[Lucene.Net] [jira] [Updated] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy updated LUCENENET-412:
---------------------------

    Fix Version/s:     (was: Lucene.Net 2.9.4)
                   Lucene.Net 2.9.4g

> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4g
>
>         Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[Lucene.Net] [jira] [Updated] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy updated LUCENENET-412:
---------------------------

    Attachment: LUCENENET-412.patch

Patch for "Document.fields"(all unit tests pass)
If it is OK, we can continue this way.

DIGY

> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: LUCENENET-412.patch
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035092#comment-13035092 ] 

Digy commented on LUCENENET-412:
--------------------------------

One more sample
{code}
From:
	class AnonymousFilterCache : FilterCache
	{
		class AnonymousFilteredDocIdSet : FilteredDocIdSet
		{
			IndexReader r;
			public AnonymousFilteredDocIdSet(DocIdSet innerSet, IndexReader r) : base(innerSet)
			{
				this.r = r;
			}
			public override bool Match(int docid)
			{
				return !r.IsDeleted(docid);
			}
		}

		public AnonymousFilterCache(DeletesMode deletesMode) : base(deletesMode)
		{
		}

		protected  override object MergeDeletes(IndexReader reader, object docIdSet)
		{
			return new AnonymousFilteredDocIdSet((DocIdSet)docIdSet, reader);
		}
	}	
	.......
	cache = new AnonymousFilterCache(deletesMode);



To:
	cache = new FilterCache<DocIdSet>(deletesMode,
		(reader,docIdSet)=>{
			return new FilteredDocIdSet((DocIdSet)docIdSet, 
			(docid) =>
			{
				return !reader.IsDeleted(docid);
			});
		});
{code}

DIGY

> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[Lucene.Net] [jira] [Commented] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "michael herndon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13024830#comment-13024830 ] 

michael herndon commented on LUCENENET-412:
-------------------------------------------

Even though its not a stated goal in the ticket, this may or may not help with decisions for the replacements of arraylists and such: since sometime in the future, targeting framework subsets are a aforementioned goal.

http://blogs.msdn.com/b/bclteam/archive/2007/06/26/non-generic-collections-to-be-removed-from-silverlight-inbar-gazit.aspx




> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: LUCENENET-412.patch
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[Lucene.Net] [jira] [Updated] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy updated LUCENENET-412:
---------------------------

    Attachment: lucene_2.9.4g_exceptions_fix

Fix for LUCENENET-172

> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[Lucene.Net] [jira] [Updated] (LUCENENET-412) Replacing ArrayLists, Hashtables etc. with appropriate Generics.

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy updated LUCENENET-412:
---------------------------

    Attachment: IEquatable for Query&Subclasses.patch

I am not sure about committing this "IEquatable" patch. To gain a slight performance improvement all "Equals" codes are dublicated. 

Here is the list of affected files:
ConstantScoreQuery.cs
DisjunctionMaxQuery.cs
FilteredQuery.cs
Function/CustomScoreQuery.cs
Function/ValueSourceQuery.cs
MatchAllDocsQuery.cs
MultiPhraseQuery.cs
MultiTermQuery.cs
Payloads/PayloadNearQuery.cs
Payloads/PayloadTermQuery.cs
PhraseQuery.cs
RangeQuery.cs
Spans/SpanFirstQuery.cs
Spans/SpanNearQuery.cs
Spans/SpanNotQuery.cs
Spans/SpanOrQuery.cs
Spans/SpanTermQuery.cs
TermQuery.cs


DIGY

> Replacing ArrayLists, Hashtables etc. with appropriate Generics.
> ----------------------------------------------------------------
>
>                 Key: LUCENENET-412
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-412
>             Project: Lucene.Net
>          Issue Type: Improvement
>    Affects Versions: Lucene.Net 2.9.4
>            Reporter: Digy
>            Priority: Minor
>             Fix For: Lucene.Net 2.9.4
>
>         Attachments: IEquatable for Query&Subclasses.patch, LUCENENET-412.patch, lucene_2.9.4g_exceptions_fix
>
>
> This will move Lucene.Net.2.9.4 closer to lucene.3.0.3 and allow some performance gains.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira