magibney commented on a change in pull request #513:
URL: https://github.com/apache/solr/pull/513#discussion_r788337887



##########
File path: 
solr/core/src/java/org/apache/solr/response/transform/DocTransformer.java
##########
@@ -52,6 +53,24 @@ public void setContext( ResultContext context ) {
 
   }
 
+  /**
+   * If this transformer wants to bypass escaping in the {@link 
org.apache.solr.response.TextResponseWriter} and
+   * write content directly to output for certain field(s), the names of any 
such field(s) should be added to the
+   * specified collection.
+   *
+   * NOTE: normally this will be conditional on the `wt` param in the request, 
as supplied to the
+   * {@link DocTransformer}'s parent {@link TransformerFactory} at the time of 
transformer creation.
+   *
+   * @param addToExisting Existing collection to which field names should be 
added.
+   * @return Collection containing field names to be written raw. If a 
non-null collection was specified as the
+   * method argument, that same collection should be returned. If the method 
argument is null, a newly-created
+   * collection should be created and returned if any field renames are 
necessary (locally created return values
+   * need not be externally modifiable -- i.e., {@link 
java.util.Collections#singleton(Object)} is acceptable).
+   */
+  public Collection<String> getRawFields(Collection<String> addToExisting) {

Review comment:
       Fair; the way this is usually invoked is directly on a single top level 
`DocTransformers` instance (extends `DocTransformer`), which collects raw 
fields from each of its child `DocTransformer` instances ... hence the 
"collector"/"accumulator" pattern. I think I agree with you though ultimately 
-- esp. given that most (probably _all_) "leaf" `DocTransformer` instances, if 
they return anything, will return one field (wrapped as a singleton). Will 
change this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to