public class ValueSourceAugmenter extends DocTransformer
Modifier and Type | Field and Description |
---|---|
String |
name |
QParser |
qparser |
ValueSource |
valueSource |
context
Constructor and Description |
---|
ValueSourceAugmenter(String name,
QParser qparser,
ValueSource valueSource) |
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.
|
getExtraRequestFields, toString
public final ValueSource valueSource
public ValueSourceAugmenter(String name, QParser qparser, ValueSource valueSource)
public String getName()
getName
in class DocTransformer
public void setContext(ResultContext context)
DocTransformer
DocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)
to provide context for any subsequent transformations.setContext
in class DocTransformer
context
- The ResultContext
stores information about how the documents were produced.DocTransformer.needsSolrIndexSearcher()
public void transform(SolrDocument doc, int docid, float score)
DocTransformer
DocTransformer.needsSolrIndexSearcher()
method must return truetransform
in class DocTransformer
doc
- The document to alterdocid
- The Lucene internal doc id, or -1 in cases where the doc
did not come from the indexscore
- the score for this documentDocTransformer.needsSolrIndexSearcher()
public boolean needsSolrIndexSearcher()
needsSolrIndexSearcher
in class DocTransformer
ResultContext.getSearcher()
,
DocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)
protected void setValue(SolrDocument doc, Object val)