lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r1687330 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/response/transform/ solr/core/src/java/org/apache/solr/search/ solr/core/src/test/org/apache/solr/response/
Date Wed, 24 Jun 2015 16:45:59 GMT
Author: noble
Date: Wed Jun 24 16:45:59 2015
New Revision: 1687330

URL: http://svn.apache.org/r1687330
Log:
SOLR-7622: changed return type from array to Set

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java
    lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java?rev=1687330&r1=1687329&r2=1687330&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java
Wed Jun 24 16:45:59 2015
@@ -63,15 +63,15 @@ public abstract class DocTransformer {
   public abstract void transform(SolrDocument doc, int docid) throws IOException;
 
   /**
-   * When a transformer needs access to fields that are not automaticaly derived from the
+   * When a transformer needs access to fields that are not automatically derived from the
    * input fields names, this option lets us explicitly say the field names that we hope
-   * will be in the SolrDocument.  These fields will be requestd from the 
+   * will be in the SolrDocument.  These fields will be requested from the
    * {@link SolrIndexSearcher} but may or may not be returned in the final
    * {@link QueryResponseWriter}
    * 
-   * @return a list of extra lucene fields
+   * @return a set of extra lucene fields
    */
-  public String[] getExtraRequestFields() {
+  public Set<String> getExtraRequestFields() {
     return null;
   }
   

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java?rev=1687330&r1=1687329&r2=1687330&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java
Wed Jun 24 16:45:59 2015
@@ -265,7 +265,7 @@ public class SolrReturnFields extends Re
             DocTransformer t = factory.create(disp, augmenterParams, req);
             if(t!=null) {
               if(!_wantsAllFields) {
-                String[] extra = t.getExtraRequestFields();
+                Set<String> extra = t.getExtraRequestFields();
                 if(extra!=null) {
                   for(String f : extra) {
                     fields.add(f); // also request this field from IndexSearcher

Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java?rev=1687330&r1=1687329&r2=1687330&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java
(original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java
Wed Jun 24 16:45:59 2015
@@ -18,7 +18,11 @@ package org.apache.solr.response;
  */
 
 import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
 
+import com.google.common.collect.ImmutableSet;
 import org.apache.lucene.document.StoredField;
 import org.apache.lucene.index.IndexableField;
 import org.apache.solr.SolrTestCaseJ4;
@@ -74,10 +78,10 @@ public class TestCustomDocTransformer ex
   public static class CustomTransformerFactory extends TransformerFactory {
     @Override
     public DocTransformer create(String field, SolrParams params, SolrQueryRequest req) {
-      String[] extra = null;
+      Set<String> extra = null;
       String ext = params.get("extra");
       if(ext!=null) {
-        extra = Strings.split(ext, ',');
+        extra = new HashSet<>(Arrays.asList(Strings.split(ext,',')));
       }
       return new CustomTransformer(field, extra);
     }
@@ -85,10 +89,10 @@ public class TestCustomDocTransformer ex
   
   public static class CustomTransformer extends DocTransformer {
     final String name;
-    final String[] extra;
+    final Set<String> extra;
     final StringBuilder str = new StringBuilder();
     
-    public CustomTransformer(String name, String[] extra) {
+    public CustomTransformer(String name, Set<String> extra) {
       this.name = name;
       this.extra = extra;
     }
@@ -99,7 +103,7 @@ public class TestCustomDocTransformer ex
     }
 
     @Override
-    public String[] getExtraRequestFields() {
+    public Set<String> getExtraRequestFields() {
       return extra;
     }
 



Mime
View raw message