You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Alan Woodward (Jira)" <ji...@apache.org> on 2021/02/08 11:07:00 UTC

[jira] [Assigned] (LUCENE-9744) NPE on a degenerate query in MinimumShouldMatchIntervalsSource$MinimumMatchesIterator.getSubMatches()

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

Alan Woodward reassigned LUCENE-9744:
-------------------------------------

    Assignee: Alan Woodward

> NPE on a degenerate query in MinimumShouldMatchIntervalsSource$MinimumMatchesIterator.getSubMatches()
> -----------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-9744
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9744
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: master (9.0), 8.7
>            Reporter: Dawid Weiss
>            Assignee: Alan Woodward
>            Priority: Major
>         Attachments: LUCENE-9744.patch, LUCENE-9744.patch
>
>
> This query:
> {code}
>               Query q1 =
>                   new IntervalQuery(
>                       FLD_TEXT1,
>                       Intervals.ordered(
>                           Intervals.atLeast(1, Intervals.term("foo")),
>                           Intervals.atLeast(1, Intervals.term("bar"))));
> {code}
> produces an NPE when retrieving match regions. Note degenerate atLeast with only one argument - this may play a role but it's not signaled anywhere before (the query itself does select the right documents, NPE blows up when matches are retrieved).
> Stack:
> {code}
> java.lang.NullPointerException
> 	at __randomizedtesting.SeedInfo.seed([2DDAAECF04D90D2F:EB69410397F8761E]:0)
> 	at org.apache.lucene.queries.intervals.MinimumShouldMatchIntervalsSource$MinimumMatchesIterator.getSubMatches(MinimumShouldMatchIntervalsSource.java:389)
> 	at org.apache.lucene.queries.intervals.CachingMatchesIterator.cache(CachingMatchesIterator.java:39)
> 	at org.apache.lucene.queries.intervals.CachingMatchesIterator.next(CachingMatchesIterator.java:68)
> 	at org.apache.lucene.queries.intervals.IntervalMatches$2.nextInterval(IntervalMatches.java:137)
> 	at org.apache.lucene.queries.intervals.OrderedIntervalsSource$OrderedIntervalIterator.nextInterval(OrderedIntervalsSource.java:166)
> 	at org.apache.lucene.queries.intervals.ConjunctionIntervalsSource.matches(ConjunctionIntervalsSource.java:89)
> 	at org.apache.lucene.queries.intervals.IntervalQuery$IntervalWeight.lambda$matches$0(IntervalQuery.java:177)
> 	at org.apache.lucene.search.MatchesUtils.forField(MatchesUtils.java:115)
> 	at org.apache.lucene.queries.intervals.IntervalQuery$IntervalWeight.matches(IntervalQuery.java:174)
> 	at org.apache.lucene.search.matchhighlight.MatchRegionRetriever.highlightDocument(MatchRegionRetriever.java:210)
> 	at org.apache.lucene.search.matchhighlight.MatchRegionRetriever.highlightDocuments(MatchRegionRetriever.java:193)
> 	at org.apache.lucene.search.matchhighlight.MatchRegionRetriever.highlightDocuments(MatchRegionRetriever.java:146)
> 	at org.apache.lucene.search.matchhighlight.MatchHighlighter.highlight(MatchHighlighter.java:236)
> 	at org.apache.lucene.search.matchhighlight.TestMatchHighlighter.lambda$testNpeOnIntervalQuery$7(TestMatchHighlighter.java:540)
> 	at org.apache.lucene.search.matchhighlight.IndexBuilder.build(IndexBuilder.java:100)
> 	at org.apache.lucene.search.matchhighlight.TestMatchHighlighter.testNpeOnIntervalQuery(TestMatchHighlighter.java:510)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
> {code}
> Repro test attached. 
> [~romseygeek], help! :)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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