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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.response.transform.DocTransformer
DocTransformer.NoopFieldTransformer
-
-
Field Summary
Fields Modifier and Type Field Description StringnameQParserqparserorg.apache.lucene.queries.function.ValueSourcevalueSource-
Fields inherited from class org.apache.solr.response.transform.DocTransformer
context
-
-
Constructor Summary
Constructors Constructor Description ValueSourceAugmenter(String name, QParser qparser, org.apache.lucene.queries.function.ValueSource valueSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()booleanneedsSolrIndexSearcher()Always returns truevoidsetContext(ResultContext context)This is called beforeDocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)to provide context for any subsequent transformations.protected voidsetValue(org.apache.solr.common.SolrDocument doc, Object val)voidtransform(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
getExtraRequestFields, getRawFields, toString, transform
-
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein classDocTransformer- Returns:
- The name of the transformer
-
setContext
public 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 classDocTransformer- Parameters:
context- TheResultContextstores information about how the documents were produced.- See Also:
DocTransformer.needsSolrIndexSearcher()
-
transform
public void transform(org.apache.solr.common.SolrDocument doc, int docid)Description 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 classDocTransformer- Parameters:
doc- The document to alterdocid- The Lucene internal doc id, or -1 in cases where thedocdid not come from the index- See Also:
DocTransformer.needsSolrIndexSearcher()
-
needsSolrIndexSearcher
public boolean needsSolrIndexSearcher()
Always returns true- Overrides:
needsSolrIndexSearcherin classDocTransformer- See Also:
ResultContext.getSearcher(),DocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)
-
setValue
protected void setValue(org.apache.solr.common.SolrDocument doc, Object val)
-
-