public class DocTransformers extends DocTransformer
context
Constructor and Description |
---|
DocTransformers() |
Modifier and Type | Method and Description |
---|---|
void |
addTransformer(DocTransformer a) |
String |
getName() |
DocTransformer |
getTransformer(int idx) |
boolean |
needsSolrIndexSearcher()
Returns true if and only if at least 1 child transformer 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. |
int |
size() |
void |
transform(SolrDocument doc,
int docid,
float score)
This is where implementations do the actual work.
|
getExtraRequestFields, toString
public String getName()
getName
in class DocTransformer
public void addTransformer(DocTransformer a)
public int size()
public DocTransformer getTransformer(int idx)
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) throws IOException
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 documentIOException
- If there is a low-level I/O error.DocTransformer.needsSolrIndexSearcher()
public boolean needsSolrIndexSearcher()
needsSolrIndexSearcher
in class DocTransformer
ResultContext.getSearcher()
,
DocTransformer.transform(org.apache.solr.common.SolrDocument, int, float)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.