Class 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
    For more information see: spatial4j/FORMATS.md

    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 a ValueSource, not a stored field
    • the value is not stored in a format the output understands (ie, raw GeoJSON)
    • Constructor Detail

      • GeoTransformerFactory

        public GeoTransformerFactory()
    • Method Detail

      • 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.