lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-7576) RegExp automaton causes NPE on Terms.intersect
Date Fri, 06 Jan 2017 19:50:58 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-7576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15805539#comment-15805539
] 

ASF subversion and git services commented on LUCENE-7576:
---------------------------------------------------------

Commit 8e974ecdcfc85243442fadf353cab4cb52a6cab2 in lucene-solr's branch refs/heads/branch_6x
from Mike McCandless
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8e974ec ]

LUCENE-7576: AutomatonTermsEnum ctor should also insist on a NORMAL CompiledAutomaton in


> RegExp automaton causes NPE on Terms.intersect
> ----------------------------------------------
>
>                 Key: LUCENE-7576
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7576
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/codecs, core/index
>    Affects Versions: 6.2.1
>         Environment: java version "1.8.0_77" macOS 10.12.1
>            Reporter: Tom Mortimer
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: master (7.0), 6.4
>
>         Attachments: LUCENE-7576.patch
>
>
> Calling org.apache.lucene.index.Terms.intersect(automaton, null) causes an NPE:
>     String index_path = <path to index>
>     String term = <a valid term name>
>     Directory directory = FSDirectory.open(Paths.get(index_path));
>     IndexReader reader = DirectoryReader.open(directory);
>     Fields fields = MultiFields.getFields(reader);
>     Terms terms = fields.terms(args[1]);
>     CompiledAutomaton automaton = new CompiledAutomaton(
>       new RegExp("do_not_match_anything").toAutomaton());
>     TermsEnum te = terms.intersect(automaton, null);
> throws:
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.lucene.codecs.blocktree.IntersectTermsEnum.<init>(IntersectTermsEnum.java:127)
> 	at org.apache.lucene.codecs.blocktree.FieldReader.intersect(FieldReader.java:185)
> 	at org.apache.lucene.index.MultiTerms.intersect(MultiTerms.java:85)
>         ...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message