", builder.toString().equals(gold) == true);
- }
-
-
- public void doTestOffsets(String in) throws Exception {
- LegacyHTMLStripCharFilter reader = new LegacyHTMLStripCharFilter(new BufferedReader(new StringReader(in)));
- int ch = 0;
- int off = 0; // offset in the reader
- int strOff = -1; // offset in the original string
- while ((ch = reader.read()) != -1) {
- int correctedOff = reader.correctOffset(off);
-
- if (ch == 'X') {
- strOff = in.indexOf('X',strOff+1);
- assertEquals(strOff, correctedOff);
- }
-
- off++;
- }
- }
-
- public void testOffsets() throws Exception {
- doTestOffsets("hello X how X are you");
- doTestOffsets("hello X
how
X are you");
- doTestOffsets("X & X ( X < > X");
-
- // test backtracking
- doTestOffsets("X < &zz >X < X > < &l > &g < X");
- }
-
- @Ignore("broken offsets: see LUCENE-2208")
- public void testRandom() throws Exception {
- Analyzer analyzer = new Analyzer() {
-
- @Override
- protected TokenStreamComponents createComponents(String fieldName) {
- Tokenizer tokenizer = new MockTokenizer(MockTokenizer.WHITESPACE, false);
- return new TokenStreamComponents(tokenizer, tokenizer);
- }
-
- @Override
- protected Reader initReader(String fieldName, Reader reader) {
- return new LegacyHTMLStripCharFilter(new BufferedReader(reader));
- }
- };
-
- int numRounds = RANDOM_MULTIPLIER * 10000;
- checkRandomData(random(), analyzer, numRounds);
- }
-
- public void testRandomBrokenHTML() throws Exception {
- int maxNumElements = 10000;
- String text = TestUtil.randomHtmlishString(random(), maxNumElements);
- Reader reader
- = new LegacyHTMLStripCharFilter(new StringReader(text));
- while (reader.read() != -1);
- }
-
- public void testRandomText() throws Exception {
- StringBuilder text = new StringBuilder();
- int minNumWords = 10;
- int maxNumWords = 10000;
- int minWordLength = 3;
- int maxWordLength = 20;
- int numWords = TestUtil.nextInt(random(), minNumWords, maxNumWords);
- switch (TestUtil.nextInt(random(), 0, 4)) {
- case 0: {
- for (int wordNum = 0 ; wordNum < numWords ; ++wordNum) {
- text.append(TestUtil.randomUnicodeString(random(), maxWordLength));
- text.append(' ');
- }
- break;
- }
- case 1: {
- for (int wordNum = 0 ; wordNum < numWords ; ++wordNum) {
- text.append(TestUtil.randomRealisticUnicodeString
- (random(), minWordLength, maxWordLength));
- text.append(' ');
- }
- break;
- }
- default: { // ASCII 50% of the time
- for (int wordNum = 0 ; wordNum < numWords ; ++wordNum) {
- text.append(TestUtil.randomSimpleString(random()));
- text.append(' ');
- }
- }
- }
- Reader reader = new LegacyHTMLStripCharFilter
- (new StringReader(text.toString()));
- while (reader.read() != -1);
- }
-}
diff --git a/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java b/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java
index a883f991c40..0171c3a6fb2 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ShardRoutingTest.java
@@ -17,32 +17,15 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
-import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.request.UpdateRequest;
import org.apache.solr.client.solrj.response.QueryResponse;
-import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrInputDocument;
-import org.apache.solr.common.cloud.CompositeIdRouter;
-import org.apache.solr.common.cloud.ZkNodeProps;
-import org.apache.solr.common.cloud.ZkStateReader;
-import org.apache.solr.common.params.CommonParams;
-import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.ShardParams;
-import org.apache.solr.common.util.StrUtils;
-import org.apache.solr.servlet.SolrDispatchFilter;
-import org.apache.solr.update.DirectUpdateHandler2;
import org.junit.BeforeClass;
-import org.junit.Ignore;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
public class ShardRoutingTest extends AbstractFullDistribZkTestBase {
@@ -137,7 +120,7 @@ public class ShardRoutingTest extends AbstractFullDistribZkTestBase {
private void doHashingTest() throws Exception {
log.info("### STARTING doHashingTest");
assertEquals(4, cloudClient.getZkStateReader().getClusterState().getCollection(DEFAULT_COLLECTION).getSlices().size());
- String shardKeys = ShardParams.SHARD_KEYS;
+ String shardKeys = ShardParams._ROUTE_;
// for now, we know how ranges will be distributed to shards.
// may have to look it up in clusterstate if that assumption changes.
@@ -282,12 +265,12 @@ public class ShardRoutingTest extends AbstractFullDistribZkTestBase {
assertEquals(1, nEnd - nStart); // short circuit should prevent distrib search
nStart = getNumRequests();
- replica.client.solrClient.query( params("q","*:*", "shard.keys","b!") );
+ replica.client.solrClient.query( params("q","*:*", ShardParams._ROUTE_, "b!") );
nEnd = getNumRequests();
assertEquals(1, nEnd - nStart); // short circuit should prevent distrib search
nStart = getNumRequests();
- leader2.client.solrClient.query( params("q","*:*", "shard.keys","b!") );
+ leader2.client.solrClient.query( params("q","*:*", ShardParams._ROUTE_, "b!") );
nEnd = getNumRequests();
assertEquals(3, nEnd - nStart); // original + 2 phase distrib search. we could improve this!
@@ -297,12 +280,12 @@ public class ShardRoutingTest extends AbstractFullDistribZkTestBase {
assertEquals(9, nEnd - nStart); // original + 2 phase distrib search * 4 shards.
nStart = getNumRequests();
- leader2.client.solrClient.query( params("q","*:*", "shard.keys","b!,d!") );
+ leader2.client.solrClient.query( params("q","*:*", ShardParams._ROUTE_, "b!,d!") );
nEnd = getNumRequests();
assertEquals(5, nEnd - nStart); // original + 2 phase distrib search * 2 shards.
nStart = getNumRequests();
- leader2.client.solrClient.query( params("q","*:*", "shard.keys","b!,f1!f2!") );
+ leader2.client.solrClient.query( params("q","*:*", ShardParams._ROUTE_, "b!,f1!f2!") );
nEnd = getNumRequests();
assertEquals(5, nEnd - nStart);
}
diff --git a/solr/core/src/test/org/apache/solr/core/TestConfig.java b/solr/core/src/test/org/apache/solr/core/TestConfig.java
index 023ab5a42b8..41d83d31b93 100644
--- a/solr/core/src/test/org/apache/solr/core/TestConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestConfig.java
@@ -17,17 +17,14 @@
package org.apache.solr.core;
-import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.TieredMergePolicy;
-import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.handler.admin.ShowFileRequestHandler;
-import org.apache.solr.update.DirectUpdateHandler2;
-import org.apache.solr.update.SolrIndexConfig;
-import org.apache.solr.util.RefCounted;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.IndexSchemaFactory;
+import org.apache.solr.update.SolrIndexConfig;
import org.junit.BeforeClass;
import org.junit.Test;
import org.w3c.dom.Node;
@@ -36,7 +33,6 @@ import org.w3c.dom.NodeList;
import javax.xml.xpath.XPathConstants;
import java.io.IOException;
import java.io.InputStream;
-import java.util.Locale;
public class TestConfig extends SolrTestCaseJ4 {
@@ -117,7 +113,7 @@ public class TestConfig extends SolrTestCaseJ4 {
SolrIndexConfig sic = sc.indexConfig;
assertEquals("default ramBufferSizeMB", 100.0D, sic.ramBufferSizeMB, 0.0D);
assertEquals("default LockType", SolrIndexConfig.LOCK_TYPE_NATIVE, sic.lockType);
- assertEquals("default useCompoundFile", false, sic.useCompoundFile);
+ assertEquals("default useCompoundFile", false, sic.getUseCompoundFile());
IndexSchema indexSchema = IndexSchemaFactory.buildIndexSchema("schema.xml", solrConfig);
IndexWriterConfig iwc = sic.toIndexWriterConfig(indexSchema);
@@ -140,7 +136,7 @@ public class TestConfig extends SolrTestCaseJ4 {
Double.parseDouble(System.getProperty("solr.tests.ramBufferSizeMB")),
sic.ramBufferSizeMB, 0.0D);
assertEquals("useCompoundFile sysprop",
- Boolean.parseBoolean(System.getProperty("useCompoundFile")), sic.useCompoundFile);
+ Boolean.parseBoolean(System.getProperty("useCompoundFile")), sic.getUseCompoundFile());
}
}
diff --git a/solr/core/src/test/org/apache/solr/highlight/DummyHighlighter.java b/solr/core/src/test/org/apache/solr/highlight/DummyHighlighter.java
index 0d660b40ecd..3836a12b86a 100644
--- a/solr/core/src/test/org/apache/solr/highlight/DummyHighlighter.java
+++ b/solr/core/src/test/org/apache/solr/highlight/DummyHighlighter.java
@@ -16,15 +16,14 @@
*/
package org.apache.solr.highlight;
-import java.io.IOException;
-
import org.apache.lucene.search.Query;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
-import org.apache.solr.core.SolrConfig;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.search.DocList;
+import java.io.IOException;
+
public class DummyHighlighter extends SolrHighlighter {
@Override
@@ -35,9 +34,4 @@ public class DummyHighlighter extends SolrHighlighter {
return fragments;
}
- @Override
- public void initalize(SolrConfig config) {
- // do nothing
- }
-
}
diff --git a/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java b/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
index 482c02e79ea..e63066f7361 100644
--- a/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
+++ b/solr/core/src/test/org/apache/solr/search/QueryParsingTest.java
@@ -20,10 +20,9 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.schema.SchemaField;
-import org.apache.solr.search.SortSpec;
import org.apache.solr.common.SolrException;
import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.schema.SchemaField;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -79,7 +78,7 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
SortSpec spec;
SolrQueryRequest req = req();
- sort = QueryParsing.parseSort("score desc", req);
+ sort = QueryParsing.parseSortSpec("score desc", req).getSort();
assertNull("sort", sort);//only 1 thing in the list, no Sort specified
spec = QueryParsing.parseSortSpec("score desc", req);
@@ -89,7 +88,7 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
assertEquals(0, spec.getSchemaFields().size());
// SOLR-4458 - using different case variations of asc and desc
- sort = QueryParsing.parseSort("score aSc", req);
+ sort = QueryParsing.parseSortSpec("score aSc", req).getSort();
SortField[] flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.SCORE);
assertTrue(flds[0].getReverse());
@@ -102,7 +101,7 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
assertEquals(1, spec.getSchemaFields().size());
assertNull(spec.getSchemaFields().get(0));
- sort = QueryParsing.parseSort("weight dEsC", req);
+ sort = QueryParsing.parseSortSpec("weight dEsC", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.FLOAT);
assertEquals(flds[0].getField(), "weight");
@@ -118,7 +117,7 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
assertNotNull(spec.getSchemaFields().get(0));
assertEquals("weight", spec.getSchemaFields().get(0).getName());
- sort = QueryParsing.parseSort("weight desc,bday ASC", req);
+ sort = QueryParsing.parseSortSpec("weight desc,bday ASC", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.FLOAT);
assertEquals(flds[0].getField(), "weight");
@@ -127,7 +126,7 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
assertEquals(flds[1].getField(), "bday");
assertEquals(flds[1].getReverse(), false);
//order aliases
- sort = QueryParsing.parseSort("weight top,bday asc", req);
+ sort = QueryParsing.parseSortSpec("weight top,bday asc", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.FLOAT);
assertEquals(flds[0].getField(), "weight");
@@ -135,7 +134,7 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
assertEquals(flds[1].getType(), SortField.Type.LONG);
assertEquals(flds[1].getField(), "bday");
assertEquals(flds[1].getReverse(), false);
- sort = QueryParsing.parseSort("weight top,bday bottom", req);
+ sort = QueryParsing.parseSortSpec("weight top,bday bottom", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.FLOAT);
assertEquals(flds[0].getField(), "weight");
@@ -145,20 +144,20 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
assertEquals(flds[1].getReverse(), false);
//test weird spacing
- sort = QueryParsing.parseSort("weight DESC, bday asc", req);
+ sort = QueryParsing.parseSortSpec("weight DESC, bday asc", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.FLOAT);
assertEquals(flds[0].getField(), "weight");
assertEquals(flds[1].getField(), "bday");
assertEquals(flds[1].getType(), SortField.Type.LONG);
//handles trailing commas
- sort = QueryParsing.parseSort("weight desc,", req);
+ sort = QueryParsing.parseSortSpec("weight desc,", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.FLOAT);
assertEquals(flds[0].getField(), "weight");
//test functions
- sort = QueryParsing.parseSort("pow(weight, 2) desc", req);
+ sort = QueryParsing.parseSortSpec("pow(weight, 2) desc", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.REWRITEABLE);
//Not thrilled about the fragility of string matching here, but...
@@ -166,12 +165,12 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
assertEquals(flds[0].getField(), "pow(float(weight),const(2))");
//test functions (more deep)
- sort = QueryParsing.parseSort("sum(product(r_f1,sum(d_f1,t_f1,1.0)),a_f1) asc", req);
+ sort = QueryParsing.parseSortSpec("sum(product(r_f1,sum(d_f1,t_f1,1.0)),a_f1) asc", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.REWRITEABLE);
assertEquals(flds[0].getField(), "sum(product(float(r_f1),sum(float(d_f1),float(t_f1),const(1.0))),float(a_f1))");
- sort = QueryParsing.parseSort("pow(weight, 2.0) desc", req);
+ sort = QueryParsing.parseSortSpec("pow(weight, 2.0) desc", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.REWRITEABLE);
//Not thrilled about the fragility of string matching here, but...
@@ -202,19 +201,19 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
assertEquals("bday", schemaFlds.get(2).getName());
//handles trailing commas
- sort = QueryParsing.parseSort("weight desc,", req);
+ sort = QueryParsing.parseSortSpec("weight desc,", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.FLOAT);
assertEquals(flds[0].getField(), "weight");
//Test literals in functions
- sort = QueryParsing.parseSort("strdist(foo_s1, \"junk\", jw) desc", req);
+ sort = QueryParsing.parseSortSpec("strdist(foo_s1, \"junk\", jw) desc", req).getSort();
flds = sort.getSort();
assertEquals(flds[0].getType(), SortField.Type.REWRITEABLE);
//the value sources get wrapped, so the out field is different than the input
assertEquals(flds[0].getField(), "strdist(str(foo_s1),literal(junk), dist=org.apache.lucene.search.spell.JaroWinklerDistance)");
- sort = QueryParsing.parseSort("", req);
+ sort = QueryParsing.parseSortSpec("", req).getSort();
assertNull(sort);
spec = QueryParsing.parseSortSpec("", req);
@@ -231,40 +230,40 @@ public class QueryParsingTest extends SolrTestCaseJ4 {
//test some bad vals
try {
- sort = QueryParsing.parseSort("weight, desc", req);
+ sort = QueryParsing.parseSortSpec("weight, desc", req).getSort();
assertTrue(false);
} catch (SolrException e) {
//expected
}
try {
- sort = QueryParsing.parseSort("w", req);
+ sort = QueryParsing.parseSortSpec("w", req).getSort();
assertTrue(false);
} catch (SolrException e) {
//expected
}
try {
- sort = QueryParsing.parseSort("weight desc, bday", req);
+ sort = QueryParsing.parseSortSpec("weight desc, bday", req).getSort();
assertTrue(false);
} catch (SolrException e) {
}
try {
//bad number of commas
- sort = QueryParsing.parseSort("pow(weight,,2) desc, bday asc", req);
+ sort = QueryParsing.parseSortSpec("pow(weight,,2) desc, bday asc", req).getSort();
assertTrue(false);
} catch (SolrException e) {
}
try {
//bad function
- sort = QueryParsing.parseSort("pow() desc, bday asc", req);
+ sort = QueryParsing.parseSortSpec("pow() desc, bday asc", req).getSort();
assertTrue(false);
} catch (SolrException e) {
}
try {
//bad number of parens
- sort = QueryParsing.parseSort("pow((weight,2) desc, bday asc", req);
+ sort = QueryParsing.parseSortSpec("pow((weight,2) desc, bday asc", req).getSort();
assertTrue(false);
} catch (SolrException e) {
}
diff --git a/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
index dde06e4145b..e941412a8ee 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/SignatureUpdateProcessorFactoryTest.java
@@ -17,12 +17,7 @@
package org.apache.solr.update.processor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
import org.apache.lucene.util.Constants;
-
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.impl.BinaryRequestWriter;
import org.apache.solr.client.solrj.request.UpdateRequest;
@@ -30,20 +25,23 @@ import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.MultiMapSolrParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.params.UpdateParams;
-import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.ContentStream;
import org.apache.solr.common.util.ContentStreamBase;
+import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
-import org.apache.solr.handler.BinaryUpdateRequestHandler;
import org.apache.solr.handler.UpdateRequestHandler;
+import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
-import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
/**
*
*/
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java
index 50fc1fe76ab..80eb623a79c 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java
@@ -17,13 +17,6 @@
package org.apache.solr.client.solrj;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.regex.Pattern;
-
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.FacetParams;
import org.apache.solr.common.params.HighlightParams;
@@ -32,6 +25,13 @@ import org.apache.solr.common.params.StatsParams;
import org.apache.solr.common.params.TermsParams;
import org.apache.solr.common.util.DateUtil;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.regex.Pattern;
+
/**
* This is an augmented SolrParams with get/set/add fields for common fields used
@@ -443,14 +443,6 @@ public class SolrQuery extends ModifiableSolrParams
return this;
}
- /**
- * @deprecated use {@link #setFacetMissing(Boolean)}
- */
- @Deprecated
- public SolrQuery setMissing(String fld) {
- return setFacetMissing(Boolean.valueOf(fld));
- }
-
/** get facet sort
*
* @return facet sort or default of {@link FacetParams#FACET_SORT_COUNT}
@@ -459,18 +451,6 @@ public class SolrQuery extends ModifiableSolrParams
return this.get(FacetParams.FACET_SORT, FacetParams.FACET_SORT_COUNT);
}
- /** get facet sort
- *
- * @return facet sort or default of true.
- * true corresponds to
- * {@link FacetParams#FACET_SORT_COUNT} and
false to {@link FacetParams#FACET_SORT_INDEX}
- *
- * @deprecated Use {@link #getFacetSortString()} instead.
- */
- @Deprecated
- public boolean getFacetSort() {
- return this.get(FacetParams.FACET_SORT, FacetParams.FACET_SORT_COUNT).equals(FacetParams.FACET_SORT_COUNT);
- }
/** set facet sort
*
@@ -482,19 +462,6 @@ public class SolrQuery extends ModifiableSolrParams
return this;
}
- /** set facet sort
- *
- * @param sort sort facets
- * @return this
- * @deprecated Use {@link #setFacetSort(String)} instead, true corresponds to
- * {@link FacetParams#FACET_SORT_COUNT} and false to {@link FacetParams#FACET_SORT_INDEX}.
- */
- @Deprecated
- public SolrQuery setFacetSort(boolean sort) {
- this.set(FacetParams.FACET_SORT, sort == true ? FacetParams.FACET_SORT_COUNT : FacetParams.FACET_SORT_INDEX);
- return this;
- }
-
/** add highlight field
*
* @param f field to enable for highlighting
@@ -571,57 +538,6 @@ public class SolrQuery extends ModifiableSolrParams
return this.get(HighlightParams.SIMPLE_POST, "");
}
- /**
- * Replaces the sort string with a single sort field.
- * @deprecated Use {@link #setSort(SortClause)} instead, which is part
- * of an api handling a wider range of sort specifications.
- */
- @Deprecated
- public SolrQuery setSortField(String field, ORDER order) {
- this.remove(CommonParams.SORT);
- addValueToParam(CommonParams.SORT, toSortString(field, order));
- return this;
- }
-
- /**
- * Adds a sort field to the end of the sort string.
- * @deprecated Use {@link #addSort(SortClause)} instead, which is part
- * of an api handling a wider range of sort specifications.
- */
- @Deprecated
- public SolrQuery addSortField(String field, ORDER order) {
- return addValueToParam(CommonParams.SORT, toSortString(field, order));
- }
-
- /**
- * Removes a sort field to the end of the sort string.
- * @deprecated Use {@link #removeSort(SortClause)} instead, which is part
- * of an api handling a wider range of sort specifications.
- */
- @Deprecated
- public SolrQuery removeSortField(String field, ORDER order) {
- String[] sorts = getSortFields();
- if (sorts != null) {
- String removeSort = toSortString(field, order);
- String s = join(sorts, ",", removeSort);
- if (s.length()==0) s=null;
- this.set(CommonParams.SORT, s);
- }
- return this;
- }
-
- /**
- * Gets an array of sort specifications.
- * @deprecated Use {@link #getSorts()} instead, which is part
- * of an api handling a wider range of sort specifications.
- */
- @Deprecated
- public String[] getSortFields() {
- String s = getSortField();
- if (s==null) return null;
- return s.trim().split(", *");
- }
-
/**
* Gets the raw sort field, as it will be sent to Solr.
*
@@ -978,22 +894,6 @@ public class SolrQuery extends ModifiableSolrParams
return this.get(CommonParams.QT);
}
- /**
- * @deprecated See {@link #setRequestHandler(String)}.
- */
- @Deprecated
- public SolrQuery setQueryType(String qt) {
- return setRequestHandler(qt);
- }
-
- /**
- * @deprecated See {@link #getRequestHandler()}.
- */
- @Deprecated
- public String getQueryType() {
- return getRequestHandler();
- }
-
/**
* @return this
* @see ModifiableSolrParams#set(String,String[])
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
index 607e29eacb0..9b8f8227f92 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
@@ -923,9 +923,6 @@ public class CloudSolrClient extends SolrClient {
}
String shardKeys = reqParams.get(ShardParams._ROUTE_);
- if(shardKeys == null) {
- shardKeys = reqParams.get(ShardParams.SHARD_KEYS); // deprecated
- }
// TODO: not a big deal because of the caching, but we could avoid looking
// at every shard
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
index 2c4a2c1dec6..320a16e7fcf 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
@@ -587,14 +587,6 @@ public class CoreAdminRequest extends SolrRequest
return req.process( client );
}
- @Deprecated
- public static CoreAdminResponse persist(String fileName, SolrClient client) throws SolrServerException, IOException
- {
- CoreAdminRequest.Persist req = new CoreAdminRequest.Persist();
- req.setFileName(fileName);
- return req.process(client);
- }
-
public static CoreAdminResponse mergeIndexes(String name,
String[] indexDirs, String[] srcCores, SolrClient client) throws SolrServerException,
IOException {
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/RangeFacet.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/RangeFacet.java
index 22708ced563..52b4e6b98d1 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/RangeFacet.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/RangeFacet.java
@@ -84,11 +84,6 @@ public abstract class RangeFacet {
public static class Numeric extends RangeFacet {
- @Deprecated
- public Numeric(String name, Number start, Number end, Number gap, Number before, Number after) {
- this(name, start, end, gap, before, after, null);
- }
-
public Numeric(String name, Number start, Number end, Number gap, Number before, Number after, Number between) {
super(name, start, end, gap, before, after, between);
}
@@ -97,11 +92,6 @@ public abstract class RangeFacet {
public static class Date extends RangeFacet {
- @Deprecated
- public Date(String name, java.util.Date start, java.util.Date end, String gap, Number before, Number after) {
- this(name, start, end, gap, before, after, null);
- }
-
public Date(String name, java.util.Date start, java.util.Date end, String gap, Number before, Number after, Number between) {
super(name, start, end, gap, before, after, between);
}
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/SpellCheckResponse.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/SpellCheckResponse.java
index 1118e9ddcaa..a3ae45daa16 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/SpellCheckResponse.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/SpellCheckResponse.java
@@ -210,18 +210,6 @@ public class SpellCheckResponse {
return alternativeFrequencies;
}
- @Deprecated
- /** @see #getAlternatives */
- public List getSuggestions() {
- return alternatives;
- }
-
- @Deprecated
- /** @see #getAlternativeFrequencies */
- public List getSuggestionFrequencies() {
- return alternativeFrequencies;
- }
-
}
public class Collation {
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java b/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java
index a4bcca0aba1..9f33d6f962e 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java
@@ -17,21 +17,6 @@
package org.apache.solr.client.solrj.util;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URLEncoder;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TimeZone;
-import java.nio.ByteBuffer;
-
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.SolrInputField;
@@ -43,6 +28,18 @@ import org.apache.solr.common.util.ContentStreamBase;
import org.apache.solr.common.util.DateUtil;
import org.apache.solr.common.util.XML;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.URLEncoder;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
/**
*
@@ -186,44 +183,6 @@ public class ClientUtils
//---------------------------------------------------------------------------------------
- /**
- * @deprecated Use {@link org.apache.solr.common.util.DateUtil#DEFAULT_DATE_FORMATS}
- */
- @Deprecated
- public static final Collection fmts = DateUtil.DEFAULT_DATE_FORMATS;
-
- /**
- * Returns a formatter that can be use by the current thread if needed to
- * convert Date objects to the Internal representation.
- *
- * @deprecated Use {@link org.apache.solr.common.util.DateUtil#parseDate(String)}
- */
- @Deprecated
- public static Date parseDate( String d ) throws ParseException
- {
- return DateUtil.parseDate(d);
- }
-
- /**
- * Returns a formatter that can be use by the current thread if needed to
- * convert Date objects to the Internal representation.
- *
- * @deprecated use {@link org.apache.solr.common.util.DateUtil#getThreadLocalDateFormat()}
- */
- @Deprecated
- public static DateFormat getThreadLocalDateFormat() {
-
- return DateUtil.getThreadLocalDateFormat();
- }
-
- /**
- * @deprecated Use {@link org.apache.solr.common.util.DateUtil#UTC}.
- */
- @Deprecated
- public static TimeZone UTC = DateUtil.UTC;
-
-
-
/**
* See: {@link org.apache.lucene.queryparser.classic queryparser syntax}
* for more information on Escaping Special Characters
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java
index be18d65043c..ceac4ecaf66 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java
@@ -17,6 +17,12 @@ package org.apache.solr.common.cloud;
* limitations under the License.
*/
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
+import org.noggit.JSONWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -26,12 +32,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrException.ErrorCode;
-import org.noggit.JSONWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* Immutable state of the cloud. Normally you can get the state by using
* {@link ZkStateReader#getClusterState()}.
@@ -45,18 +45,6 @@ public class ClusterState implements JSONWriter.Writable {
private final Map collectionStates;
private Set liveNodes;
-
- /**
- * Use this constr when ClusterState is meant for publication.
- *
- * hashCode and equals will only depend on liveNodes and not clusterStateVersion.
- */
- @Deprecated
- public ClusterState(Set liveNodes,
- Map collectionStates) {
- this(null, liveNodes, collectionStates);
- }
-
/**
* Use this constr when ClusterState is meant for consumption.
*/
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java
index 1fd82e1dc3a..8e421bd21fb 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ImplicitDocRouter.java
@@ -31,9 +31,9 @@ import static org.apache.solr.common.params.ShardParams._ROUTE_;
/** This document router is for custom sharding
*/
public class ImplicitDocRouter extends DocRouter {
+
public static final String NAME = "implicit";
-// @Deprecated
-// public static final String DEFAULT_SHARD_PARAM = "_shard_";
+
private static Logger log = LoggerFactory
.getLogger(ImplicitDocRouter.class);
@@ -49,7 +49,6 @@ public class ImplicitDocRouter extends DocRouter {
}
if(shard == null) {
Object o = sdoc.getFieldValue(_ROUTE_);
- if (o == null) o = sdoc.getFieldValue("_shard_");//deprecated . for backcompat remove later
if (o != null) {
shard = o.toString();
}
@@ -58,7 +57,6 @@ public class ImplicitDocRouter extends DocRouter {
if (shard == null) {
shard = params.get(_ROUTE_);
- if(shard == null) shard =params.get("_shard_"); //deperecated for back compat
}
if (shard != null) {
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/AppendedSolrParams.java b/solr/solrj/src/java/org/apache/solr/common/params/AppendedSolrParams.java
index 298e0c14087..4c9cc2e44e4 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/AppendedSolrParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/AppendedSolrParams.java
@@ -24,11 +24,11 @@ package org.apache.solr.common.params;
*/
public class AppendedSolrParams extends DefaultSolrParams {
- /**
- * @deprecated (3.6) Use {@link SolrParams#wrapAppended(SolrParams, SolrParams)} instead.
- */
- @Deprecated
- public AppendedSolrParams(SolrParams main, SolrParams extra) {
+ public static AppendedSolrParams wrapAppended(SolrParams params, SolrParams extra) {
+ return new AppendedSolrParams(params, extra);
+ }
+
+ private AppendedSolrParams(SolrParams main, SolrParams extra) {
super(main, extra);
}
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/DefaultSolrParams.java b/solr/solrj/src/java/org/apache/solr/common/params/DefaultSolrParams.java
index 36936e4a7ab..1f308cdc9f8 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/DefaultSolrParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/DefaultSolrParams.java
@@ -24,14 +24,11 @@ import java.util.LinkedHashSet;
*
*/
public class DefaultSolrParams extends SolrParams {
+
protected final SolrParams params;
protected final SolrParams defaults;
- /**
- * @deprecated (3.6) Use {@link SolrParams#wrapDefaults(SolrParams, SolrParams)} instead.
- */
- @Deprecated
- public DefaultSolrParams(SolrParams params, SolrParams defaults) {
+ protected DefaultSolrParams(SolrParams params, SolrParams defaults) {
assert params != null && defaults != null;
this.params = params;
this.defaults = defaults;
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/FacetParams.java b/solr/solrj/src/java/org/apache/solr/common/params/FacetParams.java
index 0509ea568ef..0947494d03a 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/FacetParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/FacetParams.java
@@ -309,25 +309,6 @@ public interface FacetParams {
}
}
- /**
- * @deprecated Use {@link FacetRangeOther}
- */
- @Deprecated
- public enum FacetDateOther {
- BEFORE, AFTER, BETWEEN, ALL, NONE;
- @Override
- public String toString() { return super.toString().toLowerCase(Locale.ROOT); }
- public static FacetDateOther get(String label) {
- try {
- return valueOf(label.toUpperCase(Locale.ROOT));
- } catch (IllegalArgumentException e) {
- throw new SolrException
- (SolrException.ErrorCode.BAD_REQUEST,
- label+" is not a valid type of 'other' range facet information",e);
- }
- }
- }
-
/**
* An enumeration of the legal values for {@link #FACET_DATE_INCLUDE} and {@link #FACET_RANGE_INCLUDE}
*
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java b/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
index a17be2aec23..46a9fc08d90 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
@@ -45,10 +45,6 @@ public interface ShardParams {
/** Should things fail if there is an error? (true/false) */
public static final String SHARDS_TOLERANT = "shards.tolerant";
-
- /** Should things fail if there is an error? (true/false) */
- @Deprecated
- public static final String SHARD_KEYS = "shard.keys";
/** query purpose for shard requests */
public static final String SHARDS_PURPOSE = "shards.purpose";
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java b/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java
index 10f07b80d87..36d0df1a117 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java
@@ -17,17 +17,17 @@
package org.apache.solr.common.params;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.SimpleOrderedMap;
+import org.apache.solr.common.util.StrUtils;
+
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.SimpleOrderedMap;
-import org.apache.solr.common.util.StrUtils;
-
/** SolrParams hold request parameters.
*
*
@@ -282,7 +282,6 @@ public abstract class SolrParams implements Serializable {
}
}
- @SuppressWarnings({"deprecation"})
public static SolrParams wrapDefaults(SolrParams params, SolrParams defaults) {
if (params == null)
return defaults;
@@ -291,13 +290,12 @@ public abstract class SolrParams implements Serializable {
return new DefaultSolrParams(params,defaults);
}
- @SuppressWarnings({"deprecation"})
public static SolrParams wrapAppended(SolrParams params, SolrParams defaults) {
if (params == null)
return defaults;
if (defaults == null)
return params;
- return new AppendedSolrParams(params,defaults);
+ return AppendedSolrParams.wrapAppended(params,defaults);
}
/** Create a Map<String,String> from a NamedList given no keys are repeated */
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
index d28b1030d25..76e66af62c8 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
@@ -256,7 +256,7 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
SolrQuery query = new SolrQuery();
query.setQuery( "*:*" );
- query.addSortField( "price", SolrQuery.ORDER.asc );
+ query.addSort(new SolrQuery.SortClause("price", SolrQuery.ORDER.asc));
QueryResponse rsp = client.query( query );
assertEquals(2, rsp.getResults().getNumFound());
@@ -495,7 +495,7 @@ abstract public class SolrExampleTests extends SolrExampleTestsBase
SolrQuery query = new SolrQuery();
query.setQuery( "*:*" );
query.set( CommonParams.FL, "id,price,[docid],[explain style=nl],score,aaa:[value v=aaa],ten:[value v=10 t=int]" );
- query.addSortField( "price", SolrQuery.ORDER.asc );
+ query.addSort(new SolrQuery.SortClause("price", SolrQuery.ORDER.asc));
QueryResponse rsp = client.query( query );
SolrDocumentList out = rsp.getResults();
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
index 800b48fb426..7b5be047a83 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
@@ -70,14 +70,14 @@ public class SolrQueryTest extends LuceneTestCase {
b = q.removeFacetQuery("a:b");
Assert.assertEquals(null, q.getFacetQuery());
- q.addSortField("price", SolrQuery.ORDER.asc);
- q.addSortField("date", SolrQuery.ORDER.desc);
- q.addSortField("qty", SolrQuery.ORDER.desc);
- q.removeSortField("date", SolrQuery.ORDER.desc);
- Assert.assertEquals(2, q.getSortFields().length);
- q.removeSortField("price", SolrQuery.ORDER.asc);
- q.removeSortField("qty", SolrQuery.ORDER.desc);
- Assert.assertEquals(null, q.getSortFields());
+ q.addSort("price", SolrQuery.ORDER.asc);
+ q.addSort("date", SolrQuery.ORDER.desc);
+ q.addSort("qty", SolrQuery.ORDER.desc);
+ q.removeSort(new SortClause("date", SolrQuery.ORDER.desc));
+ Assert.assertEquals(2, q.getSorts().size());
+ q.removeSort(new SortClause("price", SolrQuery.ORDER.asc));
+ q.removeSort(new SortClause("qty", SolrQuery.ORDER.desc));
+ Assert.assertEquals(0, q.getSorts().size());
q.addHighlightField("hl1");
q.addHighlightField("hl2");
@@ -103,21 +103,6 @@ public class SolrQueryTest extends LuceneTestCase {
// System.out.println(q);
}
-
- /*
- * Verifies that the old (deprecated) sort methods
- * allows mix-and-match between the raw field and
- * the itemized apis.
- */
- public void testSortFieldRawStringAndMethods() {
- SolrQuery q = new SolrQuery("dog");
- q.set("sort", "price asc,date desc,qty desc");
- q.removeSortField("date", SolrQuery.ORDER.desc);
- Assert.assertEquals(2, q.getSortFields().length);
- q.set("sort", "price asc, date desc, qty desc");
- q.removeSortField("date", SolrQuery.ORDER.desc);
- Assert.assertEquals(2, q.getSortFields().length);
- }
/*
* Verifies that you can use removeSortField() twice, which
@@ -125,13 +110,13 @@ public class SolrQueryTest extends LuceneTestCase {
*/
public void testSortFieldRemoveAfterRemove() {
SolrQuery q = new SolrQuery("dog");
- q.addSortField("price", SolrQuery.ORDER.asc);
- q.addSortField("date", SolrQuery.ORDER.desc);
- q.addSortField("qty", SolrQuery.ORDER.desc);
- q.removeSortField("date", SolrQuery.ORDER.desc);
- Assert.assertEquals(2, q.getSortFields().length);
- q.removeSortField("qty", SolrQuery.ORDER.desc);
- Assert.assertEquals(1, q.getSortFields().length);
+ q.addSort("price", SolrQuery.ORDER.asc);
+ q.addSort("date", SolrQuery.ORDER.desc);
+ q.addSort("qty", SolrQuery.ORDER.desc);
+ q.removeSort("date");
+ Assert.assertEquals(2, q.getSorts().size());
+ q.removeSort("qty");
+ Assert.assertEquals(1, q.getSorts().size());
}
/*
@@ -140,9 +125,9 @@ public class SolrQueryTest extends LuceneTestCase {
*/
public void testSortFieldRemoveLast() {
SolrQuery q = new SolrQuery("dog");
- q.addSortField("date", SolrQuery.ORDER.desc);
- q.addSortField("qty", SolrQuery.ORDER.desc);
- q.removeSortField("qty", SolrQuery.ORDER.desc);
+ q.addSort("date", SolrQuery.ORDER.desc);
+ q.addSort("qty", SolrQuery.ORDER.desc);
+ q.removeSort("qty");
Assert.assertEquals("date desc", q.getSortField());
}
@@ -276,9 +261,9 @@ public class SolrQueryTest extends LuceneTestCase {
public void testFacetSortLegacy() {
SolrQuery q = new SolrQuery("dog");
- assertTrue("expected default value to be true", q.getFacetSort());
- q.setFacetSort(false);
- assertFalse("expected set value to be false", q.getFacetSort());
+ assertEquals("expected default value to be SORT_COUNT", FacetParams.FACET_SORT_COUNT, q.getFacetSortString());
+ q.setFacetSort(FacetParams.FACET_SORT_INDEX);
+ assertEquals("expected set value to be SORT_INDEX", FacetParams.FACET_SORT_INDEX, q.getFacetSortString());
}
public void testFacetNumericRange() {
@@ -343,7 +328,7 @@ public class SolrQueryTest extends LuceneTestCase {
assertEquals("foo", q.setFacetPrefix("foo").get( FacetParams.FACET_PREFIX, null ) );
assertEquals("foo", q.setFacetPrefix("a", "foo").getFieldParam( "a", FacetParams.FACET_PREFIX, null ) );
- assertEquals( Boolean.TRUE, q.setMissing(Boolean.TRUE.toString()).getBool( FacetParams.FACET_MISSING ) );
+ assertEquals( Boolean.TRUE, q.setFacetMissing(Boolean.TRUE).getBool( FacetParams.FACET_MISSING ) );
assertEquals( Boolean.FALSE, q.setFacetMissing( Boolean.FALSE ).getBool( FacetParams.FACET_MISSING ) );
assertEquals( "true", q.setParam( "xxx", true ).getParams( "xxx" )[0] );
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index b7f484197d6..373bb4ee42c 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -51,7 +51,7 @@ import org.apache.solr.core.CoreDescriptor;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.core.SolrResourceLoader;
-import org.apache.solr.handler.JsonUpdateRequestHandler;
+import org.apache.solr.handler.UpdateRequestHandler;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestHandler;
@@ -1062,20 +1062,6 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
@Override
public String toString() { return xml; }
}
-
- /**
- * @see IOUtils#rm(Path...)
- */
- @Deprecated()
- public static boolean recurseDelete(File f) {
- try {
- IOUtils.rm(f.toPath());
- return true;
- } catch (IOException e) {
- System.err.println(e.toString());
- return false;
- }
- }
public void clearIndex() {
assertU(delQ("*:*"));
@@ -1095,7 +1081,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
DirectSolrConnection connection = new DirectSolrConnection(core);
SolrRequestHandler handler = core.getRequestHandler("/update/json");
if (handler == null) {
- handler = new JsonUpdateRequestHandler();
+ handler = new UpdateRequestHandler();
handler.init(null);
}
return connection.request(handler, args, json);