Class RenameFieldTransformer
java.lang.Object
org.apache.solr.response.transform.DocTransformer
org.apache.solr.response.transform.RenameFieldTransformer
Return a field with a name that is different that what is indexed
- Since:
- solr 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.response.transform.DocTransformer
DocTransformer.NoopFieldTransformer -
Field Summary
Fields inherited from class org.apache.solr.response.transform.DocTransformer
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]When a transformer needs access to fields that are not automatically derived from the input fields names, this option lets us explicitly say the field names that we hope will be in the SolrDocument.getName()voidtransform(org.apache.solr.common.SolrDocument doc, int docid, DocIterationInfo docInfo) This is where implementations do the actual work.Methods inherited from class org.apache.solr.response.transform.DocTransformer
getRawFields, needsSolrIndexSearcher, setContext, toString
-
Constructor Details
-
RenameFieldTransformer
-
-
Method Details
-
getName
- Specified by:
getNamein classDocTransformer- Returns:
- The name of the transformer
-
transform
Description copied from class:DocTransformerThis is where implementations do the actual work. If implementations require a valid docId and index access, theDocTransformer.needsSolrIndexSearcher()method must return true- Specified by:
transformin classDocTransformer- Parameters:
doc- The document to alterdocid- The Lucene internal doc id, or -1 in cases where thedocdid not come from the indexdocInfo- the document information for this document, including the score. Do not passnull, instead useDocIterationInfo.NONE.- See Also:
-
getExtraRequestFields
Description copied from class:DocTransformerWhen a transformer needs access to fields that are not automatically derived from the input fields names, this option lets us explicitly say the field names that we hope will be in the SolrDocument. These fields will be requested from theSolrIndexSearcherbut may or may not be returned in the finalQueryResponseWriter- Overrides:
getExtraRequestFieldsin classDocTransformer- Returns:
- a list of extra lucene fields
-