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 aShape
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
Shape
is 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 Constructor Description GeoTransformerFactory()
-
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.-
Methods inherited from class org.apache.solr.response.transform.TransformerFactory
init
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.response.transform.TransformerFactory.FieldRenamer
mayModifyValue
-
-
-
-
Method Detail
-
create
public DocTransformer create(String display, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
- Specified by:
create
in 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.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.
-
-