lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romseyg...@apache.org
Subject svn commit: r1653555 [2/2] - in /lucene/dev/branches/branch_5x: ./ solr/ solr/contrib/ solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ solr/c...
Date Wed, 21 Jan 2015 15:20:20 GMT
Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/FacetParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/FacetParams.java?rev=1653555&r1=1653554&r2=1653555&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/FacetParams.java
(original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/FacetParams.java
Wed Jan 21 15:20:18 2015
@@ -310,25 +310,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}
    * <p>
    * <ul>

Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java?rev=1653555&r1=1653554&r2=1653555&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
(original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
Wed Jan 21 15:20:18 2015
@@ -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";

Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java?rev=1653555&r1=1653554&r2=1653555&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java
(original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java
Wed Jan 21 15:20:18 2015
@@ -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 impleme
     }
   }
 
-  @SuppressWarnings({"deprecation"})
   public static SolrParams wrapDefaults(SolrParams params, SolrParams defaults) {
     if (params == null)
       return defaults;
@@ -291,13 +290,12 @@ public abstract class SolrParams impleme
     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&lt;String,String&gt; from a NamedList given no keys are repeated
*/

Modified: lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java?rev=1653555&r1=1653554&r2=1653555&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
(original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
Wed Jan 21 15:20:18 2015
@@ -256,7 +256,7 @@ abstract public class SolrExampleTests e
     
     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 e
     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();

Modified: lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java?rev=1653555&r1=1653554&r2=1653555&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
(original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrQueryTest.java
Wed Jan 21 15:20:18 2015
@@ -70,14 +70,14 @@ public class SolrQueryTest extends Lucen
     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 Lucen
     
     // 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 Lucen
    */
   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 Lucen
    */
   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 Lucen
 
   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 Lucen
       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] );
 

Modified: lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1653555&r1=1653554&r2=1653555&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
(original)
+++ lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
Wed Jan 21 15:20:18 2015
@@ -51,7 +51,7 @@ import org.apache.solr.core.CoreDescript
 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 ext
     @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 ext
     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);



Mime
View raw message