org.apache.solr.response.transform

## Class ValueSourceAugmenter

- java.lang.Object
- - org.apache.solr.response.transform.DocTransformer
  - - org.apache.solr.response.transform.ValueSourceAugmenter

-     public class ValueSourceAugmenter
      extends DocTransformer

  Add values from a ValueSource (function query etc) NOT really sure how or if this could work...
  Since:
    solr 4.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `name`
    `QParser` | `qparser`
    `ValueSource` | `valueSource`

    - ### Fields inherited from class org.apache.solr.response.transform.DocTransformer

      `context`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValueSourceAugmenter(String name, QParser qparser, ValueSource valueSource)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getName()`
    `boolean` | `needsSolrIndexSearcher()` Always returns true
    `void` | `setContext(ResultContext context)` This is called before `DocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)` to provide context for any subsequent transformations.
    `protected void` | `setValue(SolrDocument doc, Object val)`
    `void` | `transform(SolrDocument doc, int docid, float score)` This is where implementations do the actual work.

    - ### Methods inherited from class org.apache.solr.response.transform.DocTransformer

      `getExtraRequestFields, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### name

          public final String name

    - #### qparser

          public final QParser qparser

    - #### valueSource

          public final ValueSource valueSource

  - ### Constructor Detail

    - #### ValueSourceAugmenter

          public ValueSourceAugmenter(String name,
                                      QParser qparser,
                                      ValueSource valueSource)

  - ### Method Detail

    - #### getName

          public String getName()

      Specified by:
        `getName` in class `DocTransformer`
      Returns:
        The name of the transformer

    - #### setContext

          public void setContext(ResultContext context)

      Description copied from class: `DocTransformer`
      This is called before `DocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)` to provide context for any subsequent transformations.
      Overrides:
        `setContext` in class `DocTransformer`
      Parameters:
        `context` - The `ResultContext` stores information about how the documents were produced.
      See Also:
        `DocTransformer.needsSolrIndexSearcher()`

    - #### transform

          public void transform(SolrDocument doc,
                                int docid,
                                float score)

      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
        `score` - the score for this document
      See Also:
        `DocTransformer.needsSolrIndexSearcher()`

    - #### needsSolrIndexSearcher

          public boolean needsSolrIndexSearcher()

      Always returns true
      Overrides:
        `needsSolrIndexSearcher` in class `DocTransformer`
      See Also:
        `ResultContext.getSearcher()`, `DocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)`

    - #### setValue

          protected void setValue(SolrDocument doc,
                                  Object val)

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.