lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emil Müller (JIRA) <j...@apache.org>
Subject [jira] [Updated] (LUCENENET-615) PerFieldAnalyzerWrapper.GetTokenStream throws NullReferenceException
Date Mon, 12 Aug 2019 14:24:00 GMT

     [ https://issues.apache.org/jira/browse/LUCENENET-615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emil Müller updated LUCENENET-615:
----------------------------------
    Description: 
var english = new EnglishAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);

var whitespace = new WhitespaceAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);{{var pf
= new PerFieldAnalyzerWrapper(_englishAnalyzer, new Dictionary<string, Analyzer>() {

{ "foo", whitespaceAnalyzer }

});}}

var test1 = english.GetTokenStream(null, question); // Does not throw

var test2 = pf.GetTokenStream(null, question); // Throws NullReferenceException

 

I don't think I'm doing anything wrong, but the last line crashes with the abovementioned
exception.

  was:
{{var english = new EnglishAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);}}

{{var whitespace = new WhitespaceAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);}}{{var
pf = new PerFieldAnalyzerWrapper(_englishAnalyzer, new Dictionary<string, Analyzer>()
{

{ "foo", whitespaceAnalyzer }

});}}

{{var test1 = english.GetTokenStream(null, question); // Does not throw}}

{{var test2 = pf.GetTokenStream(null, question); // Throws NullReferenceException}}

 

I don't think I'm doing anything wrong, but the last line crashes with the abovementioned
exception.


> PerFieldAnalyzerWrapper.GetTokenStream throws NullReferenceException
> --------------------------------------------------------------------
>
>                 Key: LUCENENET-615
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-615
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net.Analysis.Common
>    Affects Versions: Lucene.Net 4.8.0
>            Reporter: Emil Müller
>            Priority: Major
>
> var english = new EnglishAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);
> var whitespace = new WhitespaceAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48);{{var
pf = new PerFieldAnalyzerWrapper(_englishAnalyzer, new Dictionary<string, Analyzer>()
{
> { "foo", whitespaceAnalyzer }
> });}}
> var test1 = english.GetTokenStream(null, question); // Does not throw
> var test2 = pf.GetTokenStream(null, question); // Throws NullReferenceException
>  
> I don't think I'm doing anything wrong, but the last line crashes with the abovementioned
exception.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Mime
View raw message