Class GeoTransformerFactory
java.lang.Object
org.apache.solr.response.transform.TransformerFactory
org.apache.solr.response.transform.GeoTransformerFactory
- All Implemented Interfaces:
TransformerFactory.FieldRenamer,NamedListInitializedPlugin
public class GeoTransformerFactory
extends TransformerFactory
implements TransformerFactory.FieldRenamer
This DocumentTransformer will write a
Shape to the SolrDocument using the requested
format. Supported formats include:
- GeoJSON
- WKT
- Polyshape
The shape is either read from a stored field, or a ValueSource.
This transformer is useful when:
- You want to return a format different than the stored encoding (WKT vs GeoJSON)
- The
Shapeis stored in aValueSource, not a stored field - the value is not stored in a format the output understands (ie, raw GeoJSON)
-
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 -
Method Summary
Modifier and TypeMethodDescriptioncreate(String display, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req) 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 byTransformerFactorys that produceDocTransformers that may rename fields.Methods inherited from class org.apache.solr.response.transform.TransformerFactory
initMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.response.transform.TransformerFactory.FieldRenamer
mayModifyValue
-
Constructor Details
-
GeoTransformerFactory
public GeoTransformerFactory()
-
-
Method Details
-
create
public DocTransformer create(String display, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req) - Specified by:
createin classTransformerFactory
-
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.
-