public class AnnotatorSubprocessor extends Object implements IDocumentSubprocessor
| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_ANNOTATED_BY |
static String |
FIELD_ANNOTATES |
static String |
FIELD_ANNOTATION |
static String |
FIELD_COMMENT |
| Constructor and Description |
|---|
AnnotatorSubprocessor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canProcess(String formatId)
Returns true if subprocessor should be run against object
|
List<ISolrDataField> |
getFieldList() |
List<String> |
getFieldsToMerge() |
List<String> |
getMatchDocuments() |
SolrDoc |
mergeWithIndexedDocument(SolrDoc indexDocument)
Merge updates with existing solr documents
|
protected SolrDoc |
parseAnnotation(InputStream is)
Parse the annotation for fields
|
Map<String,SolrDoc> |
processDocument(String annotationId,
Map<String,SolrDoc> docs,
InputStream is)
Method allows for manipulation of indexed fields that should be added to solr index
|
void |
setFieldList(List<ISolrDataField> fieldList) |
void |
setFieldsToMerge(List<String> fieldsToMerge) |
void |
setMatchDocuments(List<String> matchDocuments) |
public static final String FIELD_ANNOTATION
public static final String FIELD_ANNOTATES
public static final String FIELD_ANNOTATED_BY
public static final String FIELD_COMMENT
public List<ISolrDataField> getFieldList()
public void setFieldList(List<ISolrDataField> fieldList)
public boolean canProcess(String formatId)
canProcess in interface IDocumentSubprocessorformatId - the the document to be processedpublic Map<String,SolrDoc> processDocument(String annotationId, Map<String,SolrDoc> docs, InputStream is) throws Exception
IDocumentSubprocessorprocessDocument in interface IDocumentSubprocessorannotationId - id of original document in Map docsdocs - Documents indexed by identifiersis - original document streamExceptionprotected SolrDoc parseAnnotation(InputStream is)
the - stream of the [JSON] annotationpublic SolrDoc mergeWithIndexedDocument(SolrDoc indexDocument) throws IOException, org.apache.commons.codec.EncoderException, XPathExpressionException
mergeWithIndexedDocument in interface IDocumentSubprocessorindexDocument - IOExceptionorg.apache.commons.codec.EncoderExceptionXPathExpressionExceptionCopyright © 2022. All rights reserved.