Class DocTransformers
- java.lang.Object
- 
- org.apache.solr.response.transform.DocTransformer
- 
- org.apache.solr.response.transform.DocTransformers
 
 
- 
 public class DocTransformers extends DocTransformer Transform a document before it gets sent out
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.solr.response.transform.DocTransformerDocTransformer.NoopFieldTransformer
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.solr.response.transform.DocTransformercontext
 
- 
 - 
Constructor SummaryConstructors Constructor Description DocTransformers()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransformer(DocTransformer a)StringgetName()Collection<String>getRawFields()If this transformer wants to bypass escaping in theTextResponseWriterand write content directly to output for certain field(s), the names of any such field(s) should be returnedDocTransformergetTransformer(int idx)booleanneedsSolrIndexSearcher()Returns true if and only if at least 1 child transformer returns truevoidsetContext(ResultContext context)This is called beforeDocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)to provide context for any subsequent transformations.intsize()voidtransform(org.apache.solr.common.SolrDocument doc, int docid)This is where implementations do the actual work.voidtransform(org.apache.solr.common.SolrDocument doc, int docid, float score)This is where implementations do the actual work.- 
Methods inherited from class org.apache.solr.response.transform.DocTransformergetExtraRequestFields, toString
 
- 
 
- 
- 
- 
Method Detail- 
getNamepublic String getName() - Specified by:
- getNamein class- DocTransformer
- Returns:
- The name of the transformer
 
 - 
getRawFieldspublic Collection<String> getRawFields() Description copied from class:DocTransformerIf this transformer wants to bypass escaping in theTextResponseWriterand write content directly to output for certain field(s), the names of any such field(s) should be returnedNOTE: normally this will be conditional on the `wt` param in the request, as supplied to the DocTransformer's parentTransformerFactoryat the time of transformer creation.- Overrides:
- getRawFieldsin class- DocTransformer
- Returns:
- Collection containing field names to be written raw; if no field names should be
     written raw, an empty collection should be returned. Any collection returned collection
     need not be externally modifiable -- i.e., Collections.singleton(Object)is acceptable.
 
 - 
addTransformerpublic void addTransformer(DocTransformer a) 
 - 
sizepublic int size() 
 - 
getTransformerpublic DocTransformer getTransformer(int idx) 
 - 
setContextpublic void setContext(ResultContext context) Description copied from class:DocTransformerThis is called beforeDocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)to provide context for any subsequent transformations.- Overrides:
- setContextin class- DocTransformer
- Parameters:
- context- The- ResultContextstores information about how the documents were produced.
- See Also:
- DocTransformer.needsSolrIndexSearcher()
 
 - 
transformpublic void transform(org.apache.solr.common.SolrDocument doc, int docid, float score) throws IOExceptionDescription 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 trueDefault implementation calls DocTransformer.transform(SolrDocument, int).- Overrides:
- transformin class- DocTransformer
- Parameters:
- doc- The document to alter
- docid- The Lucene internal doc id, or -1 in cases where the- docdid not come from the index
- score- the score for this document
- Throws:
- IOException- If there is a low-level I/O error.
- See Also:
- DocTransformer.needsSolrIndexSearcher()
 
 - 
transformpublic void transform(org.apache.solr.common.SolrDocument doc, int docid) throws IOExceptionDescription 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 class- DocTransformer
- Parameters:
- doc- The document to alter
- docid- The Lucene internal doc id, or -1 in cases where the- docdid not come from the index
- Throws:
- IOException- If there is a low-level I/O error.
- See Also:
- DocTransformer.needsSolrIndexSearcher()
 
 - 
needsSolrIndexSearcherpublic boolean needsSolrIndexSearcher() Returns true if and only if at least 1 child transformer returns true- Overrides:
- needsSolrIndexSearcherin class- DocTransformer
- See Also:
- ResultContext.getSearcher(),- DocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)
 
 
- 
 
-