Class SolrEmitter
- java.lang.Object
- 
- org.apache.tika.pipes.emitter.AbstractEmitter
- 
- org.apache.tika.pipes.emitter.solr.SolrEmitter
 
 
- 
- All Implemented Interfaces:
- Initializable,- Emitter
 
 public class SolrEmitter extends AbstractEmitter implements Initializable 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSolrEmitter.AttachmentStrategystatic classSolrEmitter.UpdateStrategy
 - 
Field SummaryFields Modifier and Type Field Description static StringDEFAULT_EMBEDDED_FILE_FIELD_NAME
 - 
Constructor SummaryConstructors Constructor Description SolrEmitter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckInitialization(InitializableProblemHandler problemHandler)voidemit(String emitKey, List<Metadata> metadataList)voidemit(List<? extends EmitData> batch)The default behavior is to callEmitter.emit(String, List)on each item.intgetCommitWithin()voidinitialize(Map<String,Param> params)voidsetAttachmentStrategy(String attachmentStrategy)Options: SKIP, CONCATENATE_CONTENT, PARENT_CHILD.voidsetAuthScheme(String authScheme)voidsetCommitWithin(int commitWithin)voidsetConnectionTimeout(int connectionTimeout)voidsetEmbeddedFileFieldName(String embeddedFileFieldName)If using theSolrEmitter.AttachmentStrategy.PARENT_CHILD, this is the field name used to store the child documents.voidsetIdField(String idField)Specify the field in the first Metadata that should be used as the id field for the document.voidsetPassword(String password)voidsetProxyHost(String proxyHost)voidsetProxyPort(int proxyPort)voidsetSocketTimeout(int socketTimeout)voidsetSolrCollection(String solrCollection)voidsetSolrUrls(List<String> solrUrls)voidsetSolrZkChroot(String solrZkChroot)voidsetSolrZkHosts(List<String> solrZkHosts)voidsetUpdateStrategy(String updateStrategy)voidsetUserName(String userName)- 
Methods inherited from class org.apache.tika.pipes.emitter.AbstractEmittergetName, setName
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_EMBEDDED_FILE_FIELD_NAMEpublic static String DEFAULT_EMBEDDED_FILE_FIELD_NAME 
 
- 
 - 
Constructor Detail- 
SolrEmitterpublic SolrEmitter() throws TikaConfigException- Throws:
- TikaConfigException
 
 
- 
 - 
Method Detail- 
emitpublic void emit(String emitKey, List<Metadata> metadataList) throws IOException, TikaEmitterException - Specified by:
- emitin interface- Emitter
- Throws:
- IOException
- TikaEmitterException
 
 - 
emitpublic void emit(List<? extends EmitData> batch) throws IOException, TikaEmitterException Description copied from class:AbstractEmitterThe default behavior is to callEmitter.emit(String, List)on each item. Some implementations, e.g. Solr/ES/vespa, can benefit from subclassing this and emitting a bunch of docs at once.- Specified by:
- emitin interface- Emitter
- Overrides:
- emitin class- AbstractEmitter
- Throws:
- IOException
- TikaEmitterException
 
 - 
setAttachmentStrategy@Field public void setAttachmentStrategy(String attachmentStrategy) Options: SKIP, CONCATENATE_CONTENT, PARENT_CHILD. Default is "PARENT_CHILD". If set to "SKIP", this will index only the main file and ignore all info in the attachments. If set to "CONCATENATE_CONTENT", this will concatenate the content extracted from the attachments into the main document and then index the main document with the concatenated content _and_ the main document's metadata (metadata from attachments will be thrown away). If set to "PARENT_CHILD", this will index the attachments as children of the parent document via Solr's parent-child relationship.
 - 
setConnectionTimeout@Field public void setConnectionTimeout(int connectionTimeout) 
 - 
setSocketTimeout@Field public void setSocketTimeout(int socketTimeout) 
 - 
getCommitWithinpublic int getCommitWithin() 
 - 
setCommitWithin@Field public void setCommitWithin(int commitWithin) 
 - 
setIdField@Field public void setIdField(String idField) Specify the field in the first Metadata that should be used as the id field for the document.- Parameters:
- idField-
 
 - 
setProxyPort@Field public void setProxyPort(int proxyPort) 
 - 
setEmbeddedFileFieldName@Field public void setEmbeddedFileFieldName(String embeddedFileFieldName) If using theSolrEmitter.AttachmentStrategy.PARENT_CHILD, this is the field name used to store the child documents. Note that we artificially flatten all embedded documents, no matter how nested in the container document, into direct children of the root document.- Parameters:
- embeddedFileFieldName-
 
 - 
initializepublic void initialize(Map<String,Param> params) throws TikaConfigException - Specified by:
- initializein interface- Initializable
- Parameters:
- params- params to use for initialization
- Throws:
- TikaConfigException
 
 - 
checkInitializationpublic void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException - Specified by:
- checkInitializationin interface- Initializable
- Parameters:
- problemHandler- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.
- Throws:
- TikaConfigException
 
 
- 
 
-