diff --git a/.classpath b/.classpath index f50d41e72..c5d003b56 100644 --- a/.classpath +++ b/.classpath @@ -63,13 +63,11 @@ - - @@ -134,6 +132,6 @@ - + diff --git a/contrib/adsabs/src/java/org/apache/lucene/analysis/miscellaneous/AqpWordDelimiterFilter.java b/contrib/adsabs/src/java/org/apache/lucene/analysis/miscellaneous/AqpWordDelimiterFilter.java index a98abdcd1..481d36daa 100644 --- a/contrib/adsabs/src/java/org/apache/lucene/analysis/miscellaneous/AqpWordDelimiterFilter.java +++ b/contrib/adsabs/src/java/org/apache/lucene/analysis/miscellaneous/AqpWordDelimiterFilter.java @@ -24,7 +24,7 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.TypeAttribute; -import org.apache.lucene.analysis.util.CharArraySet; +import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.AttributeSource; import org.apache.lucene.util.InPlaceMergeSorter; diff --git a/contrib/adsabs/src/java/org/apache/lucene/analysis/miscellaneous/AqpWordDelimiterFilterFactory.java b/contrib/adsabs/src/java/org/apache/lucene/analysis/miscellaneous/AqpWordDelimiterFilterFactory.java index 4d3abc043..2e219f68f 100644 --- a/contrib/adsabs/src/java/org/apache/lucene/analysis/miscellaneous/AqpWordDelimiterFilterFactory.java +++ b/contrib/adsabs/src/java/org/apache/lucene/analysis/miscellaneous/AqpWordDelimiterFilterFactory.java @@ -19,7 +19,7 @@ import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.analysis.util.CharArraySet; +import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.util.ResourceLoader; import org.apache.lucene.analysis.util.ResourceLoaderAware; import org.apache.lucene.analysis.util.TokenFilterFactory; diff --git a/contrib/adsabs/src/java/org/apache/lucene/search/SecondOrderListOfDocsScorer.java b/contrib/adsabs/src/java/org/apache/lucene/search/SecondOrderListOfDocsScorer.java index dde1d34a9..c35db0c8f 100644 --- a/contrib/adsabs/src/java/org/apache/lucene/search/SecondOrderListOfDocsScorer.java +++ b/contrib/adsabs/src/java/org/apache/lucene/search/SecondOrderListOfDocsScorer.java @@ -53,7 +53,7 @@ public DocIdSetIterator iterator() { @Override public int docID() { if (idx < 0) { - return -1; + return NO_MORE_DOCS; } else if (idx < hits.size()) { return doc; } else { diff --git a/contrib/adsabs/src/test/monty/solr/util/MontySolrQueryTestCase.java b/contrib/adsabs/src/test/monty/solr/util/MontySolrQueryTestCase.java index 908ee27c4..e8d927401 100644 --- a/contrib/adsabs/src/test/monty/solr/util/MontySolrQueryTestCase.java +++ b/contrib/adsabs/src/test/monty/solr/util/MontySolrQueryTestCase.java @@ -26,7 +26,6 @@ import org.getopt.luke.GrowableStringArray; import org.junit.BeforeClass; - public class MontySolrQueryTestCase extends MontySolrAbstractTestCase { protected static AqpTestAbstractCase tp = new AqpTestAbstractCase() { diff --git a/contrib/adsabs/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpAdsabs.java b/contrib/adsabs/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpAdsabs.java index 175174352..f24fb66cb 100644 --- a/contrib/adsabs/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpAdsabs.java +++ b/contrib/adsabs/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpAdsabs.java @@ -150,7 +150,7 @@ public void testDateRanges() throws Exception { assertQueryEquals("2000-", null, "date:[2000 TO \\*]"); // i don't think we should try to guess this as a date - assertQueryEquals("2011", null, ""); + assertQueryEquals("2011", null, "MatchNoDocsQuery(\"\")"); assertQueryEquals("2011", wsa, "2011"); } @@ -261,7 +261,7 @@ public void testModifiers() throws Exception { // this is an example of how complex the query parsing can be, and impossible // without a powerful builder (this would just be unthinkable with the standard // lucene parser and impossible with the invenio parser) - assertQueryEquals("#5", null, ""); + assertQueryEquals("#5", null, "MatchNoDocsQuery(\"\")"); assertQueryEquals("#(request synonyms 5)", null, "+request +synonyms"); diff --git a/contrib/adsabs/src/test/org/apache/solr/analysis/author/TestAdsabsTypeAuthorParsing.java b/contrib/adsabs/src/test/org/apache/solr/analysis/author/TestAdsabsTypeAuthorParsing.java index d706a4da8..4d97b014b 100644 --- a/contrib/adsabs/src/test/org/apache/solr/analysis/author/TestAdsabsTypeAuthorParsing.java +++ b/contrib/adsabs/src/test/org/apache/solr/analysis/author/TestAdsabsTypeAuthorParsing.java @@ -520,7 +520,7 @@ public void testAuthorParsingUseCases() throws Exception { // what happens we receive very long string (non-author thing) testAuthorQuery( "\"purpose of this review is to bridge the gap between\"", - "", + "MatchNoDocsQuery(\"\")", "//*[@numFound='0']" ); diff --git a/contrib/antlrqueryparser/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpSLGMultiField.java b/contrib/antlrqueryparser/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpSLGMultiField.java index cb45a93ab..cb5772584 100644 --- a/contrib/antlrqueryparser/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpSLGMultiField.java +++ b/contrib/antlrqueryparser/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpSLGMultiField.java @@ -58,9 +58,9 @@ public void testStopwordsParsing() throws Exception { assertStopQueryEquals("one stop", "b:one t:one"); assertStopQueryEquals("one (stop)", "b:one t:one"); assertStopQueryEquals("one ((stop))", "b:one t:one"); - assertStopQueryEquals("stop", ""); - assertStopQueryEquals("(stop)", ""); - assertStopQueryEquals("((stop))", ""); + assertStopQueryEquals("stop", "MatchNoDocsQuery(\"\")"); + assertStopQueryEquals("(stop)", "MatchNoDocsQuery(\"\")"); + assertStopQueryEquals("((stop))", "MatchNoDocsQuery(\"\")"); } // verify parsing of query using a stopping analyzer @@ -80,7 +80,7 @@ private void assertStopQueryEquals(String qtxt, String expectedRes) // The lucene (for mysterious) reasons decide to output // boolean query; so smarter qparsers have to work around // the dum engineers... - if (expectedRes.equals("") && q.toString().trim().equals("")) + if (expectedRes.equals("MatchNoDocsQuery(\"\")")) return; assertEquals(expectedRes, q.toString()); @@ -220,7 +220,7 @@ public void testStaticMethod1() throws Exception { String[] queries6 = { "((+stop))", "+((stop))" }; q = AqpQueryParserUtil.parse(qp, queries6, fields); - assertEquals(" ", q.toString()); + assertEquals("MatchNoDocsQuery(\"\") MatchNoDocsQuery(\"\")", q.toString()); String[] queries7 = { "one ((+stop)) +more", "+((stop)) +two" }; q = AqpQueryParserUtil.parse(qp, queries7, fields); diff --git a/contrib/antlrqueryparser/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpSLGStandardTest.java b/contrib/antlrqueryparser/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpSLGStandardTest.java index fe157089c..ab3781d0c 100644 --- a/contrib/antlrqueryparser/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpSLGStandardTest.java +++ b/contrib/antlrqueryparser/src/test/org/apache/lucene/queryparser/flexible/aqp/TestAqpSLGStandardTest.java @@ -390,7 +390,7 @@ public void testSlop() throws Exception { public void testNumber() throws Exception { // The numbers go away because SimpleAnalzyer ignores them - assertQueryEquals("3", null, ""); + assertQueryEquals("3", null, "MatchNoDocsQuery(\"\")"); assertQueryEquals("term 1.0 1 2", null, "term"); assertQueryEquals("term term1 term2", null, "term term term"); @@ -516,14 +516,14 @@ public void testQPA() throws Exception { assertQueryEquals("term AND NOT phrase term", qpAnalyzer, "(+term -(phrase1 phrase2)) term"); - assertQueryEquals("stop^3", qpAnalyzer, ""); - assertQueryEquals("stop", qpAnalyzer, ""); - assertQueryEquals("(stop)^3", qpAnalyzer, ""); - assertQueryEquals("((stop))^3", qpAnalyzer, ""); - assertQueryEquals("(stop^3)", qpAnalyzer, ""); - assertQueryEquals("((stop)^3)", qpAnalyzer, ""); - assertQueryEquals("(stop)", qpAnalyzer, ""); - assertQueryEquals("((stop))", qpAnalyzer, ""); + assertQueryEquals("stop^3", qpAnalyzer, "MatchNoDocsQuery(\"\")"); + assertQueryEquals("stop", qpAnalyzer, "MatchNoDocsQuery(\"\")"); + assertQueryEquals("(stop)^3", qpAnalyzer, "MatchNoDocsQuery(\"\")"); + assertQueryEquals("((stop))^3", qpAnalyzer, "MatchNoDocsQuery(\"\")"); + assertQueryEquals("(stop^3)", qpAnalyzer, "MatchNoDocsQuery(\"\")"); + assertQueryEquals("((stop)^3)", qpAnalyzer, "MatchNoDocsQuery(\"\")"); + assertQueryEquals("(stop)", qpAnalyzer, "MatchNoDocsQuery(\"\")"); + assertQueryEquals("((stop))", qpAnalyzer, "MatchNoDocsQuery(\"\")"); assertTrue(getQuery("term term term", qpAnalyzer) instanceof BooleanQuery); assertTrue(getQuery("term +stop", qpAnalyzer) instanceof TermQuery); } @@ -838,7 +838,7 @@ public void testBoost() throws Exception { q = qp2.parse("the^3", "field"); // "the" is a stop word so the result is an empty query: assertNotNull(q); - assertEquals("", q.toString()); + assertEquals("MatchNoDocsQuery(\"\")", q.toString()); assertEquals(q.getClass(), MatchNoDocsQuery.class); } diff --git a/contrib/examples/build.xml b/contrib/examples/build.xml index 65f498da7..7dcbd9a76 100644 --- a/contrib/examples/build.xml +++ b/contrib/examples/build.xml @@ -71,8 +71,6 @@ the example, so that it can run without anything else --> - - diff --git a/contrib/upstream-include.xml b/contrib/upstream-include.xml index b65714da9..bedb19f00 100644 --- a/contrib/upstream-include.xml +++ b/contrib/upstream-include.xml @@ -20,7 +20,7 @@ - + diff --git a/lib/luke-4.0.0-BETA.jar b/lib/luke-4.0.0-BETA.jar deleted file mode 100644 index 59865dfeb..000000000 Binary files a/lib/luke-4.0.0-BETA.jar and /dev/null differ diff --git a/lib/luke-with-deps.jar b/lib/luke-with-deps.jar new file mode 100644 index 000000000..266e71e48 Binary files /dev/null and b/lib/luke-with-deps.jar differ