Removed deprecated within() method from QueryBuilder
Change-Id: I7fc035523f498be91c3fc8714f388645d690433c
diff --git a/Changes b/Changes
index 2ba1664..e54e88c 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,14 @@
-0.58.1 2018-12-05
+0.58.2 2018-12-05
+ - [bugfix] Fixed the candidate list in NextSpans, see de.ids_mannheim.
+ korap.index.TestNextIndex.testNextExpansionBug() (margaretha)
+ - [bugfix] Fixed left expansion match order (margaretha)
+ - [bugfix] Fixed right expansion match order & expansion over start (margaretha)
+ - [feature] Added opt() method to QueryBuilder (diewald)
+ - [bugfix] Improved FocusSpans sorting (fixes #7) (margaretha)
+ - [bugfix] Adopt sorting for FocusSpans in SpanQueryWrappers (diewald)
+ - [cleanup] Removed deprecated within() method from QueryBuilder (diewald)
+
+0.58.1 2018-11-12
- [bugfix] Security upgrade of Jackson for CVE-2017-17485 and
CVE-2018-7489 (diewald)
- [bugfix] Span expansion with negation (margaretha)
@@ -9,13 +19,6 @@
document in NextSpans (diewald)
- [bugfix] Fixed skipTo in NextSpans, see de.ids_mannheim.korap.index.
TestRepetitionIndex.testRepetitionSnippetBug3() (margaretha)
- - [bugfix] Fixed the candidate list in NextSpans, see de.ids_mannheim.
- korap.index.TestNextIndex.testNextExpansionBug() (margaretha)
- - [bugfix] Fixed left expansion match order (margaretha)
- - [bugfix] Fixed right expansion match order & expansion over start (margaretha)
- - [feature] Added opt() method to QueryBuilder (diewald)
- - [bugfix] Improved FocusSpans sorting (margaretha)
- - [bugfix] Adopt sorting for FocusSpans in SpanQueryWrappers (diewald)
0.58.0 2018-09-03
- [feature] Implemented referencing cached collection (margaretha)
diff --git a/pom.xml b/pom.xml
index 8acde35..81d2921 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
<groupId>de.ids_mannheim.korap</groupId>
<artifactId>Krill</artifactId>
- <version>0.58.1</version>
+ <version>0.58.2</version>
<packaging>jar</packaging>
<name>Krill</name>
diff --git a/src/main/java/de/ids_mannheim/korap/query/QueryBuilder.java b/src/main/java/de/ids_mannheim/korap/query/QueryBuilder.java
index 761ddd9..ab69754 100644
--- a/src/main/java/de/ids_mannheim/korap/query/QueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/query/QueryBuilder.java
@@ -364,13 +364,6 @@
* @param embedded
* A SpanQuery that is wrapped in the element.
*/
- @Deprecated
- public SpanWithinQueryWrapper within (SpanQueryWrapper element,
- SpanQueryWrapper embedded) {
- return new SpanWithinQueryWrapper(element, embedded);
- };
-
-
public SpanWithinQueryWrapper contains (SpanQueryWrapper element,
SpanQueryWrapper embedded) {
return new SpanWithinQueryWrapper(element, embedded, WITHIN);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
index ae46eba..77f7e87 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
@@ -157,7 +157,7 @@
// Start creating query
// within(<s>, {1: {2: [mate/p=ADJA & mate/m=number:sg]}[opennlp/p=NN & tt/p=NN]})
- ks = new Krill(kq.within(kq.tag("base/s:s"), kq.nr(1,
+ ks = new Krill(kq.contains(kq.tag("base/s:s"), kq.nr(1,
kq.seq(kq.seg("mate/p:ADJA")).append(kq.seg("opennlp/p:NN")))));
KrillMeta meta = ks.getMeta();
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
index d337a8c..3c4689b 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
@@ -151,7 +151,7 @@
QueryBuilder kq = new QueryBuilder("tokens");
- SpanQueryWrapper focus = kq.focus(kq.within(kq.tag("x"), kq.or(kq.nr(1, kq.seg("s:b")), kq.nr(1, kq.seg("s:c")))));
+ SpanQueryWrapper focus = kq.focus(kq.contains(kq.tag("x"), kq.or(kq.nr(1, kq.seg("s:b")), kq.nr(1, kq.seg("s:c")))));
assertEquals("focus(1: spanContain(<tokens:x />, spanOr([{1: tokens:s:b}, {1: tokens:s:c}])),sorting)", focus.toQuery().toString());
kr = ki.search(focus.toQuery(), (short) 10);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
index 3d22662..8415953 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
@@ -41,7 +41,7 @@
public void testCase1 () throws IOException, QueryException {
QueryBuilder kq = new QueryBuilder("tokens");
ks = new Krill(kq
- .within(kq.tag("base/s:s"),
+ .contains(kq.tag("base/s:s"),
kq.seq(kq.re("s:.*")).append(kq.nr(kq.re("s:.*"))))
.toQuery());
ks.getMeta().setTimeOut(10000);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
index 30a6e10..be2a95c 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
@@ -348,7 +348,7 @@
assertEquals((long) 1, kr.getTotalResults());
// Test without matches in within
- sq = kq.within(kq.re("s:z.*e"), kq.seg("s:affe")).toQuery();
+ sq = kq.contains(kq.re("s:z.*e"), kq.seg("s:affe")).toQuery();
assertEquals(
"spanContain(SpanMultiTermQueryWrapper(base:/s:z.*e/), base:s:affe)",
sq.toString());
@@ -356,7 +356,7 @@
assertEquals((long) 0, kr.getTotalResults());
// Test without matches in within (reversed)
- sq = kq.within(kq.seg("s:affe"), kq.re("s:z.*e")).toQuery();
+ sq = kq.contains(kq.seg("s:affe"), kq.re("s:z.*e")).toQuery();
assertEquals(
"spanContain(base:s:affe, SpanMultiTermQueryWrapper(base:/s:z.*e/))",
sq.toString());
@@ -372,7 +372,7 @@
assertEquals((long) 0, kr.getTotalResults());
// Test with nested classes
- sq = kq.within(kq.nr(kq.re("s:z.*e")), kq.seg("s:affe")).toQuery();
+ sq = kq.contains(kq.nr(kq.re("s:z.*e")), kq.seg("s:affe")).toQuery();
assertEquals(
"spanContain({1: SpanMultiTermQueryWrapper(base:/s:z.*e/)}, base:s:affe)",
sq.toString());
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestKrillQuery.java b/src/test/java/de/ids_mannheim/korap/query/TestKrillQuery.java
index 97cf3f8..6d4ed84 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestKrillQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestKrillQuery.java
@@ -367,7 +367,7 @@
sqw = kq.tag("abc");
assertFalse(sqw.maybeUnsorted());
- sqw = kq.within(kq.tag("abc"), kq.seg("a"));
+ sqw = kq.contains(kq.tag("abc"), kq.seg("a"));
assertTrue(sqw.maybeUnsorted());
sqw = kq.contains(kq.tag("abc"), kq.seg("a"));
@@ -385,7 +385,7 @@
sqw = kq.matches(kq.tag("abc"), kq.seg("a"));
assertFalse(sqw.maybeUnsorted());
- sqw = kq.matches(kq.within(kq.tag("abc"), kq.seg("a")), kq.seg("a"));
+ sqw = kq.matches(kq.contains(kq.tag("abc"), kq.seg("a")), kq.seg("a"));
assertTrue(sqw.maybeUnsorted());
sqw = kq.nr(2, kq.tag("abc"));
@@ -394,7 +394,7 @@
sqw = kq.repeat(kq.tag("abc"), 4);
assertFalse(sqw.maybeUnsorted());
- sqw = kq.repeat(kq.within(kq.tag("abc"), kq.seg("a")), 4);
+ sqw = kq.repeat(kq.contains(kq.tag("abc"), kq.seg("a")), 4);
assertTrue(sqw.maybeUnsorted());
};
};