Class OpenSearchEmitter
- java.lang.Object
-
- org.apache.tika.pipes.emitter.AbstractEmitter
-
- org.apache.tika.pipes.emitter.opensearch.OpenSearchEmitter
-
- All Implemented Interfaces:
Initializable,Emitter
public class OpenSearchEmitter extends AbstractEmitter implements Initializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenSearchEmitter.AttachmentStrategystatic classOpenSearchEmitter.UpdateStrategy
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_EMBEDDED_FILE_FIELD_NAME
-
Constructor Summary
Constructors Constructor Description OpenSearchEmitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckInitialization(InitializableProblemHandler problemHandler)voidemit(String emitKey, List<Metadata> metadataList, ParseContext parseContext)voidemit(List<? extends EmitData> emitData)The default behavior is to callEmitter.emit(String, List, ParseContext)on each item.intgetCommitWithin()voidinitialize(Map<String,Param> params)voidsetAttachmentStrategy(String attachmentStrategy)Options: SEPARATE_DOCUMENTS, PARENT_CHILD.voidsetAuthScheme(String authScheme)voidsetCommitWithin(int commitWithin)voidsetConnectionTimeout(int connectionTimeout)voidsetEmbeddedFileFieldName(String embeddedFileFieldName)If using theOpenSearchEmitter.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.voidsetOpenSearchUrl(String openSearchUrl)voidsetPassword(String password)voidsetProxyHost(String proxyHost)voidsetProxyPort(int proxyPort)voidsetSocketTimeout(int socketTimeout)voidsetUpdateStrategy(String strategy)voidsetUpdateStrategy(OpenSearchEmitter.UpdateStrategy updateStrategy)voidsetUserName(String userName)-
Methods inherited from class org.apache.tika.pipes.emitter.AbstractEmitter
getName, setName
-
-
-
-
Field Detail
-
DEFAULT_EMBEDDED_FILE_FIELD_NAME
public static String DEFAULT_EMBEDDED_FILE_FIELD_NAME
-
-
Constructor Detail
-
OpenSearchEmitter
public OpenSearchEmitter() throws TikaConfigException- Throws:
TikaConfigException
-
-
Method Detail
-
emit
public void emit(List<? extends EmitData> emitData) throws IOException, TikaEmitterException
Description copied from class:AbstractEmitterThe default behavior is to callEmitter.emit(String, List, ParseContext)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 interfaceEmitter- Overrides:
emitin classAbstractEmitter- Throws:
IOExceptionTikaEmitterException
-
emit
public void emit(String emitKey, List<Metadata> metadataList, ParseContext parseContext) throws IOException, TikaEmitterException
- Specified by:
emitin interfaceEmitter- Throws:
IOExceptionTikaEmitterException
-
setAttachmentStrategy
@Field public void setAttachmentStrategy(String attachmentStrategy)
Options: SEPARATE_DOCUMENTS, PARENT_CHILD. Default is "SEPARATE_DOCUMENTS". All embedded documents are treated as independent documents. PARENT_CHILD requires a schema to be set up for the relationship type; all embedded objects (no matter how deeply nested) will have a single parent of the main container document. If you want to concatenate the content of embedded files and ignore the metadata of embedded files, setHandlerConfig's parseMode toHandlerConfig.PARSE_MODE.CONCATENATEin yourFetchEmitTupleor in the <parseMode> element in yourPipesIteratorconfiguration.
-
setConnectionTimeout
@Field public void setConnectionTimeout(int connectionTimeout)
-
setSocketTimeout
@Field public void setSocketTimeout(int socketTimeout)
-
getCommitWithin
public 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)
-
setUpdateStrategy
public void setUpdateStrategy(OpenSearchEmitter.UpdateStrategy updateStrategy)
-
setUpdateStrategy
public void setUpdateStrategy(String strategy) throws TikaConfigException
- Throws:
TikaConfigException
-
setEmbeddedFileFieldName
@Field public void setEmbeddedFileFieldName(String embeddedFileFieldName)
If using theOpenSearchEmitter.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-
-
initialize
public void initialize(Map<String,Param> params) throws TikaConfigException
- Specified by:
initializein interfaceInitializable- Parameters:
params- params to use for initialization- Throws:
TikaConfigException
-
checkInitialization
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException
- Specified by:
checkInitializationin interfaceInitializable- Parameters:
problemHandler- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.- Throws:
TikaConfigException
-
-