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 String
name
QParser
qparser
org.apache.lucene.queries.function.ValueSource
valueSource
-
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 String
getName()
boolean
needsSolrIndexSearcher()
Always returns truevoid
setContext(ResultContext context)
This is called beforeDocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)
to provide context for any subsequent transformations.protected void
setValue(org.apache.solr.common.SolrDocument doc, Object val)
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
getExtraRequestFields, getRawFields, toString, transform
-
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in classDocTransformer
- Returns:
- The name of the transformer
-
setContext
public void setContext(ResultContext context)
Description copied from class:DocTransformer
This is called beforeDocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)
to provide context for any subsequent transformations.- Overrides:
setContext
in classDocTransformer
- Parameters:
context
- TheResultContext
stores 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: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()
-
needsSolrIndexSearcher
public boolean needsSolrIndexSearcher()
Always returns true- Overrides:
needsSolrIndexSearcher
in 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)
-
-