KorAP / Krill

:mag: A Corpus Data Retrieval Index using Lucene for Look-Ups
BSD 2-Clause "Simplified" License
16 stars 3 forks source link

Multiple distances in a disjunction query #2

Closed Akron closed 8 years ago

Akron commented 9 years ago

There is an Index out of bounds bug in case of multiple distances (The example query by @bansp was "({1:Sonne []* Erde} | {2: Erde []* Sonne})" in Poliqarp+). The stack trace is:

java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(ArrayList.java:400)
    at java.util.ArrayList.get(ArrayList.java:413)
    at de.ids_mannheim.korap.query.spans.TokenDistanceSpans.cost(TokenDistanceSpans.java:128)
    at de.ids_mannheim.korap.query.spans.ClassSpans.cost(ClassSpans.java:186)
    at org.apache.lucene.search.spans.SpanOrQuery$1.initSpanQueue(SpanOrQuery.java:181)
    at org.apache.lucene.search.spans.SpanOrQuery$1.next(SpanOrQuery.java:193)
    at de.ids_mannheim.korap.KrillIndex.search(KrillIndex.java:1325)
    at de.ids_mannheim.korap.Krill.apply(Krill.java:310)
    at de.ids_mannheim.korap.Krill.apply(Krill.java:279)
    at de.ids_mannheim.korap.search.TestKrill.searchJSONtokenDistanceSpanBug(TestKrill.java:824)

There is a failing test case in the tokendistancespan-bug branch committed as https://github.com/KorAP/Krill/commit/acf46c9865401022a287f733931c256bae0b4471 .

margaretha commented 8 years ago

Fixed.

Akron commented 8 years ago

Thank you! I have readded the test that now passes.