Class DocTransformer.NoopFieldTransformer
- java.lang.Object
-
- org.apache.solr.response.transform.DocTransformer
-
- org.apache.solr.response.transform.DocTransformer.NoopFieldTransformer
-
- Enclosing class:
- DocTransformer
public static final class DocTransformer.NoopFieldTransformer extends DocTransformer
Trivial Impl that ensure that the specified field is requested as an "extra" field, but then does nothing during the transformation phase.
-
-
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 Constructor Description NoopFieldTransformer()
NoopFieldTransformer(String field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]
getExtraRequestFields()
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.String
getName()
void
transform(org.apache.solr.common.SolrDocument doc, int docid)
This is where implementations do the actual work.-
Methods inherited from class org.apache.solr.response.transform.DocTransformer
getRawFields, needsSolrIndexSearcher, setContext, toString, transform
-
-
-
-
Constructor Detail
-
NoopFieldTransformer
public NoopFieldTransformer()
-
NoopFieldTransformer
public NoopFieldTransformer(String field)
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in classDocTransformer
- Returns:
- The name of the transformer
-
getExtraRequestFields
public String[] getExtraRequestFields()
Description copied from class:DocTransformer
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. These fields will be requested from theSolrIndexSearcher
but may or may not be returned in the finalQueryResponseWriter
- Overrides:
getExtraRequestFields
in classDocTransformer
- Returns:
- a list of extra lucene fields
-
transform
public void transform(org.apache.solr.common.SolrDocument doc, int docid)
Description copied from class:DocTransformer
This is where implementations do the actual work. If implementations require a valid docId and index access, theDocTransformer.needsSolrIndexSearcher()
method must return true- Specified by:
transform
in classDocTransformer
- Parameters:
doc
- The document to alterdocid
- The Lucene internal doc id, or -1 in cases where thedoc
did not come from the index- See Also:
DocTransformer.needsSolrIndexSearcher()
-
-