public class StreamingInputDocumentFactory extends InputDocumentFactory
Faster because:
This class is fully reentrant and can be invoked in parallel.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DEFAULTDNETRESULT |
protected ThreadLocal<XMLEventFactory> |
eventFactory |
protected static String |
INDEX_RECORD_ID_ELEMENT |
protected ThreadLocal<XMLInputFactory> |
inputFactory |
protected static int |
MAX_FIELD_LENGTH |
protected ThreadLocal<XMLOutputFactory> |
outputFactory |
protected static String |
ROOT_ELEMENT |
protected static String |
TARGETFIELDS |
DS_ID, DS_VERSION, INDEX_FIELD_PREFIX, INDEX_RECORD_ID, INDEX_RESULT, RESULT| Constructor and Description |
|---|
StreamingInputDocumentFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
copyResult(org.apache.solr.common.SolrInputDocument indexDocument,
StringWriter results,
XMLEventReader parser,
List<Namespace> nsList,
String dnetResult,
ResultTransformer resultTransformer)
Copy the /indexRecord/result element and children, preserving namespace declarations etc.
|
protected String |
getText(XMLEvent text)
Helper used to get the string from a text element.
|
org.apache.solr.common.SolrInputDocument |
parseDocument(String version,
String inputDocument,
String dsId,
String resultName) |
org.apache.solr.common.SolrInputDocument |
parseDocument(String version,
String inputDocument,
String dsId,
String resultName,
ResultTransformer resultTransformer) |
protected void |
parseTargetFields(org.apache.solr.common.SolrInputDocument indexDocument,
XMLEventReader parser)
Parse the targetFields block and add fields to the solr document.
|
getParsedDateField, parseDateprotected static final String DEFAULTDNETRESULT
protected static final String TARGETFIELDS
protected static final String INDEX_RECORD_ID_ELEMENT
protected static final String ROOT_ELEMENT
protected static final int MAX_FIELD_LENGTH
protected ThreadLocal<XMLInputFactory> inputFactory
protected ThreadLocal<XMLOutputFactory> outputFactory
protected ThreadLocal<XMLEventFactory> eventFactory
public org.apache.solr.common.SolrInputDocument parseDocument(String version, String inputDocument, String dsId, String resultName) throws XMLStreamException
parseDocument in class InputDocumentFactoryXMLStreamExceptioneu.dnetlib.functionality.index.solr.feed.InputDocumentFactory#parseDocument(eu.dnetlib.functionality.index.solr.feed.IndexDocument,
java.lang.String)public org.apache.solr.common.SolrInputDocument parseDocument(String version, String inputDocument, String dsId, String resultName, ResultTransformer resultTransformer)
parseDocument in class InputDocumentFactoryeu.dnetlib.functionality.index.solr.feed.InputDocumentFactory#parseDocument(eu.dnetlib.functionality.index.solr.feed.IndexDocument,
java.lang.String, com.google.common.base.Function)protected void parseTargetFields(org.apache.solr.common.SolrInputDocument indexDocument,
XMLEventReader parser)
throws XMLStreamException
indexDocument - parser - XMLStreamExceptionprotected void copyResult(org.apache.solr.common.SolrInputDocument indexDocument,
StringWriter results,
XMLEventReader parser,
List<Namespace> nsList,
String dnetResult,
ResultTransformer resultTransformer)
throws XMLStreamException
indexDocument - results - parser - nsList - XMLStreamExceptionCopyright © 2018. All rights reserved.