Class RawValueTransformerFactory

java.lang.Object
org.apache.solr.response.transform.TransformerFactory
org.apache.solr.response.transform.RawValueTransformerFactory
All Implemented Interfaces:
TransformerFactory.FieldRenamer, NamedListInitializedPlugin

public class RawValueTransformerFactory extends TransformerFactory implements TransformerFactory.FieldRenamer
Since:
solr 5.2
  • Constructor Details

    • RawValueTransformerFactory

      public RawValueTransformerFactory()
    • RawValueTransformerFactory

      public RawValueTransformerFactory(String wt)
  • Method Details

    • init

      public void init(org.apache.solr.common.util.NamedList<?> args)
      Description copied from interface: NamedListInitializedPlugin
      init will be called just once, immediately after creation.

      Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself

      Specified by:
      init in interface NamedListInitializedPlugin
      Overrides:
      init in class TransformerFactory
      Parameters:
      args - non-null list of initialization parameters (may be empty)
    • create

      public DocTransformer create(String display, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
      Specified by:
      create in class TransformerFactory
    • mayModifyValue

      public boolean mayModifyValue()
      Description copied from interface: TransformerFactory.FieldRenamer
      Returns true if implementations of this class may (even subtly) modify field values. (GeoTransformerFactory may do this, e.g.). To fail safe, the default implementation returns true. This method should be overridden to return false if the implementing class is guaranteed to not modify any values for the fields that it renames.
      Specified by:
      mayModifyValue in interface TransformerFactory.FieldRenamer
    • create

      public DocTransformer create(String display, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req, Map<String,String> renamedFields, Set<String> reqFieldNames)
      Description copied from interface: TransformerFactory.FieldRenamer
      Analogous to TransformerFactory.create(String, SolrParams, SolrQueryRequest), but to be implemented by TransformerFactorys that produce DocTransformers that may rename fields.
      Specified by:
      create in interface TransformerFactory.FieldRenamer
      Parameters:
      display - The destination field
      params - Local params associated with this transformer (e.g., source field)
      req - The current request
      renamedFields - Maps source=>dest renamed fields. Implementations should check this first, updating their own "source" field(s) as necessary, and if renaming (not copying) fields, should also update this map with the implementations "own" introduced source=>dest field mapping
      reqFieldNames - Set of explicitly requested field names; implementations should consult this set to determine whether it's appropriate to rename (vs. copy) a field (e.g.: boolean copy = reqFieldNames != null && reqFieldNames.contains(sourceField) )
      Returns:
      A transformer to be used in processing field values in returned documents.