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.
  • Constructor Details

    • NoopFieldTransformer

      public NoopFieldTransformer()
    • NoopFieldTransformer

      public NoopFieldTransformer(String field)
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in class DocTransformer
      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 the SolrIndexSearcher but may or may not be returned in the final QueryResponseWriter
      Overrides:
      getExtraRequestFields in class DocTransformer
      Returns:
      a list of extra lucene fields
    • transform

      public void transform(org.apache.solr.common.SolrDocument doc, int docid, DocIterationInfo docInfo)
      Description copied from class: DocTransformer
      This is where implementations do the actual work. If implementations require a valid docId and index access, the DocTransformer.needsSolrIndexSearcher() method must return true
      Specified by:
      transform in class DocTransformer
      Parameters:
      doc - The document to alter
      docid - The Lucene internal doc id, or -1 in cases where the doc did not come from the index
      docInfo - the document information for this document, including the score. Do not pass null, instead use DocIterationInfo.NONE.
      See Also: