Interface TransformerFactory.FieldRenamer

    • Method Detail

      • create

        DocTransformer create​(String field,
                              org.apache.solr.common.params.SolrParams params,
                              SolrQueryRequest req,
                              Map<String,​String> renamedFields,
                              Set<String> reqFieldNames)
        Analogous to TransformerFactory.create(String, SolrParams, SolrQueryRequest), but to be implemented by TransformerFactorys that produce DocTransformers that may rename fields.
        field - 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) )
        A transformer to be used in processing field values in returned documents.
      • mayModifyValue

        default boolean mayModifyValue()
        Returns true if implementations of this class may (even subtly) modify field values. (GeoTransformerFactory may do this, e.g.). To fail safe, the default implementation returns true. This method should be overridden to return false if the implementing class is guaranteed to not modify any values for the fields that it renames.