You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Shad Storhaug <sh...@shadstorhaug.com> on 2016/08/27 08:49:36 UTC

Suggest

Is anyone working on porting over Suggest? I'd like to take a crack at it.

Thanks,
Shad Storhaug/NightOwl888

RE: Suggest

Posted by Shad Storhaug <sh...@shadstorhaug.com>.
Update
======

I have cleaned up the code and ported most of Lucene.Net.Suggest over, and also ported most of Lucene.Net.Misc because Lucene.Net.Suggest depends on it. However, I ran into a couple of snags that are preventing a compile.

Strong Names
------------------

First of all, Lucene.Net.Misc (and its tests) depend on internal members of Lucene.Net.Core. I am having trouble working out what configuration that is currently being used that allows the use of InternalsVisibleTo with a PublicKey, but is not strong named. It seems to be working (somehow) with Lucene.Net.Tests, but since neither assembly is strong named I am failing to see how. As pointed out here: https://csharpdeveloper.wordpress.com/2011/07/05/apply-your-strong-name-key-to-both-dlls-to-resolve-friend-access-was-granted-compiler-message-in-c/ and in other sources, they recommend to use a strong name key in both the provider and consumer assemblies in order to make it function. I tried it and it (of course) works, but it will basically require me to strong name every assembly in the solution.

Not that I think that is a bad thing, but before making a sweeping change like that I wanted to check whether you think that is the right decision, or if there is some other magic way to get them to use InternalsVisibleTo with a PublicKey, but with no strong name and you've already decided to use that for the whole solution. If the latter, please provide info on how to set it up. I noticed there is a strong name key in the project, but nothing currently seems to reference it.

PriorityQueue
------------------

The Suggest.Search.WordBreakSpellChecker uses the constructor overload PriorityQueue(int, IComparer<T>) (see https://github.com/apache/lucene-solr/blob/8fdf89690404c0e65784b2c5477552b9dec58591/lucene/suggest/src/java/org/apache/lucene/search/spell/WordBreakSpellChecker.java#L109-L110). Unfortunately, the current incarnation of PriorityQueue doesn't have that constructor overload (https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Core/Support/PriorityQueue.cs#L36-L62). The PriorityQueue is backed by System.Collection.List<T>, which also doesn't have a similar way to set the IComparer<T>.

In addition, Misc.HighFreqTerms (see https://github.com/apache/lucene-solr/blob/8fdf89690404c0e65784b2c5477552b9dec58591/lucene/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java#L182-L191) uses several methods of PriorityQueue that are missing (LessThan, InsertWithOverflow, Pop, etc).

So it seems that the PriorityQueue is inadequate for this part of the project. I can think of three options for resolving this:

1. Try to modify the existing PriorityQueue to support this extra functionality.
2. Port the Java PriorityQueue over and replace the existing PriorityQueue.
3. Port the Java PriorityQueue over to Lucene.Net.Misc so it can be used there and in Lucene.Net.Suggest and leave the existing PriorityQueue in Lucene.Net (core) as is.

Personally, I think the second option is the best one, let me know if that is your feeling as well.

Thanks,
Shad Storhaug/NightOwl888



-----Original Message-----
From: itamar.synhershko@gmail.com [mailto:itamar.synhershko@gmail.com] On Behalf Of Itamar Syn-Hershko
Sent: Sunday, August 28, 2016 2:04 PM
To: user@lucenenet.apache.org
Cc: dev@lucenenet.apache.org
Subject: Re: Suggest

Oh I saw you made the last commit there. It was me a while back. Go for it then.

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko> Freelance Developer & Consultant Lucene.NET committer and PMC member

On Sun, Aug 28, 2016 at 6:57 AM, Shad Storhaug <sh...@shadstorhaug.com>
wrote:

> Nope, that wasn't me. But it looks like someone cleaned it up much 
> better than auto converted code. I will try getting it integrated, as 
> it is not currently part of the solution. But since it depends on 
> Analysis I submit it to the analysis-work branch.
>
> -----Original Message-----
> From: itamar.synhershko@gmail.com [mailto:itamar.synhershko@gmail.com] 
> On Behalf Of Itamar Syn-Hershko
> Sent: Sunday, August 28, 2016 5:46 AM
> To: user@lucenenet.apache.org
> Cc: dev@lucenenet.apache.org
> Subject: Re: Suggest
>
> I believe you already did?
> https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Suggest 
> :)
>
> --
>
> Itamar Syn-Hershko
> http://code972.com | @synhershko <https://twitter.com/synhershko> 
> Freelance Developer & Consultant Lucene.NET committer and PMC member
>
> On Sat, Aug 27, 2016 at 11:49 AM, Shad Storhaug 
> <sh...@shadstorhaug.com>
> wrote:
>
> > Is anyone working on porting over Suggest? I'd like to take a crack 
> > at
> it.
> >
> > Thanks,
> > Shad Storhaug/NightOwl888
> >
>

RE: Suggest

Posted by Shad Storhaug <sh...@shadstorhaug.com>.
Update
======

I have cleaned up the code and ported most of Lucene.Net.Suggest over, and also ported most of Lucene.Net.Misc because Lucene.Net.Suggest depends on it. However, I ran into a couple of snags that are preventing a compile.

Strong Names
------------------

First of all, Lucene.Net.Misc (and its tests) depend on internal members of Lucene.Net.Core. I am having trouble working out what configuration that is currently being used that allows the use of InternalsVisibleTo with a PublicKey, but is not strong named. It seems to be working (somehow) with Lucene.Net.Tests, but since neither assembly is strong named I am failing to see how. As pointed out here: https://csharpdeveloper.wordpress.com/2011/07/05/apply-your-strong-name-key-to-both-dlls-to-resolve-friend-access-was-granted-compiler-message-in-c/ and in other sources, they recommend to use a strong name key in both the provider and consumer assemblies in order to make it function. I tried it and it (of course) works, but it will basically require me to strong name every assembly in the solution.

Not that I think that is a bad thing, but before making a sweeping change like that I wanted to check whether you think that is the right decision, or if there is some other magic way to get them to use InternalsVisibleTo with a PublicKey, but with no strong name and you've already decided to use that for the whole solution. If the latter, please provide info on how to set it up. I noticed there is a strong name key in the project, but nothing currently seems to reference it.

PriorityQueue
------------------

The Suggest.Search.WordBreakSpellChecker uses the constructor overload PriorityQueue(int, IComparer<T>) (see https://github.com/apache/lucene-solr/blob/8fdf89690404c0e65784b2c5477552b9dec58591/lucene/suggest/src/java/org/apache/lucene/search/spell/WordBreakSpellChecker.java#L109-L110). Unfortunately, the current incarnation of PriorityQueue doesn't have that constructor overload (https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Core/Support/PriorityQueue.cs#L36-L62). The PriorityQueue is backed by System.Collection.List<T>, which also doesn't have a similar way to set the IComparer<T>.

In addition, Misc.HighFreqTerms (see https://github.com/apache/lucene-solr/blob/8fdf89690404c0e65784b2c5477552b9dec58591/lucene/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java#L182-L191) uses several methods of PriorityQueue that are missing (LessThan, InsertWithOverflow, Pop, etc).

So it seems that the PriorityQueue is inadequate for this part of the project. I can think of three options for resolving this:

1. Try to modify the existing PriorityQueue to support this extra functionality.
2. Port the Java PriorityQueue over and replace the existing PriorityQueue.
3. Port the Java PriorityQueue over to Lucene.Net.Misc so it can be used there and in Lucene.Net.Suggest and leave the existing PriorityQueue in Lucene.Net (core) as is.

Personally, I think the second option is the best one, let me know if that is your feeling as well.

Thanks,
Shad Storhaug/NightOwl888



-----Original Message-----
From: itamar.synhershko@gmail.com [mailto:itamar.synhershko@gmail.com] On Behalf Of Itamar Syn-Hershko
Sent: Sunday, August 28, 2016 2:04 PM
To: user@lucenenet.apache.org
Cc: dev@lucenenet.apache.org
Subject: Re: Suggest

Oh I saw you made the last commit there. It was me a while back. Go for it then.

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko> Freelance Developer & Consultant Lucene.NET committer and PMC member

On Sun, Aug 28, 2016 at 6:57 AM, Shad Storhaug <sh...@shadstorhaug.com>
wrote:

> Nope, that wasn't me. But it looks like someone cleaned it up much 
> better than auto converted code. I will try getting it integrated, as 
> it is not currently part of the solution. But since it depends on 
> Analysis I submit it to the analysis-work branch.
>
> -----Original Message-----
> From: itamar.synhershko@gmail.com [mailto:itamar.synhershko@gmail.com] 
> On Behalf Of Itamar Syn-Hershko
> Sent: Sunday, August 28, 2016 5:46 AM
> To: user@lucenenet.apache.org
> Cc: dev@lucenenet.apache.org
> Subject: Re: Suggest
>
> I believe you already did?
> https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Suggest 
> :)
>
> --
>
> Itamar Syn-Hershko
> http://code972.com | @synhershko <https://twitter.com/synhershko> 
> Freelance Developer & Consultant Lucene.NET committer and PMC member
>
> On Sat, Aug 27, 2016 at 11:49 AM, Shad Storhaug 
> <sh...@shadstorhaug.com>
> wrote:
>
> > Is anyone working on porting over Suggest? I'd like to take a crack 
> > at
> it.
> >
> > Thanks,
> > Shad Storhaug/NightOwl888
> >
>

Re: Suggest

Posted by Itamar Syn-Hershko <it...@code972.com>.
Oh I saw you made the last commit there. It was me a while back. Go for it
then.

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Sun, Aug 28, 2016 at 6:57 AM, Shad Storhaug <sh...@shadstorhaug.com>
wrote:

> Nope, that wasn't me. But it looks like someone cleaned it up much better
> than auto converted code. I will try getting it integrated, as it is not
> currently part of the solution. But since it depends on Analysis I submit
> it to the analysis-work branch.
>
> -----Original Message-----
> From: itamar.synhershko@gmail.com [mailto:itamar.synhershko@gmail.com] On
> Behalf Of Itamar Syn-Hershko
> Sent: Sunday, August 28, 2016 5:46 AM
> To: user@lucenenet.apache.org
> Cc: dev@lucenenet.apache.org
> Subject: Re: Suggest
>
> I believe you already did?
> https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Suggest :)
>
> --
>
> Itamar Syn-Hershko
> http://code972.com | @synhershko <https://twitter.com/synhershko>
> Freelance Developer & Consultant Lucene.NET committer and PMC member
>
> On Sat, Aug 27, 2016 at 11:49 AM, Shad Storhaug <sh...@shadstorhaug.com>
> wrote:
>
> > Is anyone working on porting over Suggest? I'd like to take a crack at
> it.
> >
> > Thanks,
> > Shad Storhaug/NightOwl888
> >
>

Re: Suggest

Posted by Itamar Syn-Hershko <it...@code972.com>.
Oh I saw you made the last commit there. It was me a while back. Go for it
then.

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Sun, Aug 28, 2016 at 6:57 AM, Shad Storhaug <sh...@shadstorhaug.com>
wrote:

> Nope, that wasn't me. But it looks like someone cleaned it up much better
> than auto converted code. I will try getting it integrated, as it is not
> currently part of the solution. But since it depends on Analysis I submit
> it to the analysis-work branch.
>
> -----Original Message-----
> From: itamar.synhershko@gmail.com [mailto:itamar.synhershko@gmail.com] On
> Behalf Of Itamar Syn-Hershko
> Sent: Sunday, August 28, 2016 5:46 AM
> To: user@lucenenet.apache.org
> Cc: dev@lucenenet.apache.org
> Subject: Re: Suggest
>
> I believe you already did?
> https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Suggest :)
>
> --
>
> Itamar Syn-Hershko
> http://code972.com | @synhershko <https://twitter.com/synhershko>
> Freelance Developer & Consultant Lucene.NET committer and PMC member
>
> On Sat, Aug 27, 2016 at 11:49 AM, Shad Storhaug <sh...@shadstorhaug.com>
> wrote:
>
> > Is anyone working on porting over Suggest? I'd like to take a crack at
> it.
> >
> > Thanks,
> > Shad Storhaug/NightOwl888
> >
>

RE: Suggest

Posted by Shad Storhaug <sh...@shadstorhaug.com>.
Nope, that wasn't me. But it looks like someone cleaned it up much better than auto converted code. I will try getting it integrated, as it is not currently part of the solution. But since it depends on Analysis I submit it to the analysis-work branch.

-----Original Message-----
From: itamar.synhershko@gmail.com [mailto:itamar.synhershko@gmail.com] On Behalf Of Itamar Syn-Hershko
Sent: Sunday, August 28, 2016 5:46 AM
To: user@lucenenet.apache.org
Cc: dev@lucenenet.apache.org
Subject: Re: Suggest

I believe you already did?
https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Suggest :)

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko> Freelance Developer & Consultant Lucene.NET committer and PMC member

On Sat, Aug 27, 2016 at 11:49 AM, Shad Storhaug <sh...@shadstorhaug.com>
wrote:

> Is anyone working on porting over Suggest? I'd like to take a crack at it.
>
> Thanks,
> Shad Storhaug/NightOwl888
>

RE: Suggest

Posted by Shad Storhaug <sh...@shadstorhaug.com>.
Nope, that wasn't me. But it looks like someone cleaned it up much better than auto converted code. I will try getting it integrated, as it is not currently part of the solution. But since it depends on Analysis I submit it to the analysis-work branch.

-----Original Message-----
From: itamar.synhershko@gmail.com [mailto:itamar.synhershko@gmail.com] On Behalf Of Itamar Syn-Hershko
Sent: Sunday, August 28, 2016 5:46 AM
To: user@lucenenet.apache.org
Cc: dev@lucenenet.apache.org
Subject: Re: Suggest

I believe you already did?
https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Suggest :)

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko> Freelance Developer & Consultant Lucene.NET committer and PMC member

On Sat, Aug 27, 2016 at 11:49 AM, Shad Storhaug <sh...@shadstorhaug.com>
wrote:

> Is anyone working on porting over Suggest? I'd like to take a crack at it.
>
> Thanks,
> Shad Storhaug/NightOwl888
>

Re: Suggest

Posted by Itamar Syn-Hershko <it...@code972.com>.
I believe you already did?
https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Suggest :)

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Sat, Aug 27, 2016 at 11:49 AM, Shad Storhaug <sh...@shadstorhaug.com>
wrote:

> Is anyone working on porting over Suggest? I'd like to take a crack at it.
>
> Thanks,
> Shad Storhaug/NightOwl888
>

Re: Suggest

Posted by Itamar Syn-Hershko <it...@code972.com>.
I believe you already did?
https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Suggest :)

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Lucene.NET committer and PMC member

On Sat, Aug 27, 2016 at 11:49 AM, Shad Storhaug <sh...@shadstorhaug.com>
wrote:

> Is anyone working on porting over Suggest? I'd like to take a crack at it.
>
> Thanks,
> Shad Storhaug/NightOwl888
>