diff --git a/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java b/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java index 3075d34c41a..9dc22eac3b4 100644 --- a/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java +++ b/solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java @@ -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 automatically derived from the + * When a transformer needs access to fields that are not automaticaly 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 requested from the + * will be in the SolrDocument. These fields will be requestd from the * {@link SolrIndexSearcher} but may or may not be returned in the final * {@link QueryResponseWriter} * - * @return a set of extra lucene fields + * @return a list of extra lucene fields */ - public Set getExtraRequestFields() { + public String[] getExtraRequestFields() { return null; } diff --git a/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java b/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java index e9d394c5a8b..0307910b891 100644 --- a/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java +++ b/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java @@ -265,7 +265,7 @@ public class SolrReturnFields extends ReturnFields { DocTransformer t = factory.create(disp, augmenterParams, req); if(t!=null) { if(!_wantsAllFields) { - Set extra = t.getExtraRequestFields(); + String[] extra = t.getExtraRequestFields(); if(extra!=null) { for(String f : extra) { fields.add(f); // also request this field from IndexSearcher diff --git a/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java b/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java index a2365464e45..397e94cd5ab 100644 --- a/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java +++ b/solr/core/src/test/org/apache/solr/response/TestCustomDocTransformer.java @@ -18,11 +18,7 @@ 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.lucene.index.StorableField; @@ -79,10 +75,10 @@ public class TestCustomDocTransformer extends SolrTestCaseJ4 { public static class CustomTransformerFactory extends TransformerFactory { @Override public DocTransformer create(String field, SolrParams params, SolrQueryRequest req) { - Set extra = null; + String[] extra = null; String ext = params.get("extra"); if(ext!=null) { - extra = new HashSet<>(Arrays.asList(Strings.split(ext,','))); + extra = Strings.split(ext, ','); } return new CustomTransformer(field, extra); } @@ -90,10 +86,10 @@ public class TestCustomDocTransformer extends SolrTestCaseJ4 { public static class CustomTransformer extends DocTransformer { final String name; - final Set extra; + final String[] extra; final StringBuilder str = new StringBuilder(); - public CustomTransformer(String name, Set extra) { + public CustomTransformer(String name, String[] extra) { this.name = name; this.extra = extra; } @@ -104,7 +100,7 @@ public class TestCustomDocTransformer extends SolrTestCaseJ4 { } @Override - public Set getExtraRequestFields() { + public String[] getExtraRequestFields() { return extra; }