org.apache.solr.response.transform
Class DocTransformer
java.lang.Object
org.apache.solr.response.transform.DocTransformer
- Direct Known Subclasses:
- DocTransformers, RenameFieldTransformer, TransformerWithContext, ValueSourceAugmenter
public abstract class DocTransformer
- extends Object
A DocTransformer can add, remove or alter a Document before it is written out to the Response. For instance, there are implementations
that can put explanations inline with a document, add constant values and mark items as being artificially boosted (see QueryElevationComponent
)
New instance for each request
- See Also:
TransformerFactory
DocTransformer
public DocTransformer()
getName
public abstract String getName()
- Returns:
- The name of the transformer
setContext
public void setContext(TransformContext context)
- This is called before transform and sets
- Parameters:
context
- The TransformContext
stores information about the current state of things in Solr that may be
useful for doing transformations.
transform
public abstract void transform(SolrDocument doc,
int docid)
throws IOException
- This is where implementations do the actual work
- Parameters:
doc
- The document to alterdocid
- The Lucene internal doc id
- Throws:
IOException
- If there is a low-level I/O error.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.