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 DocTransformer
create(String display, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
DocTransformer
create(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 byTransformerFactory
s that produceDocTransformer
s that may rename fields.void
init(org.apache.solr.common.util.NamedList<?> args)
init
will be called just once, immediately after creation.boolean
mayModifyValue()
Returnstrue
if 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: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 interfaceNamedListInitializedPlugin
- Overrides:
init
in 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:
create
in classTransformerFactory
-
mayModifyValue
public boolean mayModifyValue()
Description copied from interface:TransformerFactory.FieldRenamer
Returnstrue
if implementations of this class may (even subtly) modify field values. (GeoTransformerFactory
may do this, e.g.). To fail safe, the default implementation returnstrue
. This method should be overridden to returnfalse
if the implementing class is guaranteed to not modify any values for the fields that it renames.- Specified by:
mayModifyValue
in 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.FieldRenamer
Analogous toTransformerFactory.create(String, SolrParams, SolrQueryRequest)
, but to be implemented byTransformerFactory
s that produceDocTransformer
s that may rename fields.- Specified by:
create
in 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.
-
-