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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.response.transform.TransformerFactory
TransformerFactory.FieldRenamer
-
-
Field Summary
-
Fields inherited from class org.apache.solr.response.transform.TransformerFactory
defaultFactories, defaultUserArgs
-
-
Constructor Summary
Constructors Constructor Description RawValueTransformerFactory()RawValueTransformerFactory(String wt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocTransformercreate(String display, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)DocTransformercreate(String display, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req, Map<String,String> renamedFields, Set<String> reqFieldNames)Analogous toTransformerFactory.create(String, SolrParams, SolrQueryRequest), but to be implemented byTransformerFactorys that produceDocTransformers that may rename fields.voidinit(org.apache.solr.common.util.NamedList<?> args)initwill be called just once, immediately after creation.booleanmayModifyValue()Returnstrueif implementations of this class may (even subtly) modify field values.
-
-
-
Constructor Detail
-
RawValueTransformerFactory
public RawValueTransformerFactory()
-
RawValueTransformerFactory
public RawValueTransformerFactory(String wt)
-
-
Method Detail
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
Description copied from interface:NamedListInitializedPlugininitwill 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:
initin interfaceNamedListInitializedPlugin- Overrides:
initin classTransformerFactory- 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:
createin classTransformerFactory
-
mayModifyValue
public boolean mayModifyValue()
Description copied from interface:TransformerFactory.FieldRenamerReturnstrueif implementations of this class may (even subtly) modify field values. (GeoTransformerFactorymay do this, e.g.). To fail safe, the default implementation returnstrue. This method should be overridden to returnfalseif the implementing class is guaranteed to not modify any values for the fields that it renames.- Specified by:
mayModifyValuein interfaceTransformerFactory.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.FieldRenamerAnalogous toTransformerFactory.create(String, SolrParams, SolrQueryRequest), but to be implemented byTransformerFactorys that produceDocTransformers that may rename fields.- Specified by:
createin interfaceTransformerFactory.FieldRenamer- Parameters:
display- The destination fieldparams- Local params associated with this transformer (e.g., source field)req- The current requestrenamedFields- 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 mappingreqFieldNames- 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.
-
-