Class OpenSearchEmitter
java.lang.Object
org.apache.tika.pipes.emitter.AbstractEmitter
org.apache.tika.pipes.emitter.opensearch.OpenSearchEmitter
- All Implemented Interfaces:
Initializable
,Emitter
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkInitialization
(InitializableProblemHandler problemHandler) void
emit
(String emitKey, List<Metadata> metadataList, ParseContext parseContext) void
The default behavior is to callEmitter.emit(String, List, ParseContext)
on each item.int
void
initialize
(Map<String, Param> params) void
setAttachmentStrategy
(String attachmentStrategy) Options: SEPARATE_DOCUMENTS, PARENT_CHILD.void
setAuthScheme
(String authScheme) void
setCommitWithin
(int commitWithin) void
setConnectionTimeout
(int connectionTimeout) void
setEmbeddedFileFieldName
(String embeddedFileFieldName) If using theOpenSearchEmitter.AttachmentStrategy.PARENT_CHILD
, this is the field name used to store the child documents.void
setIdField
(String idField) Specify the field in the first Metadata that should be used as the id field for the document.void
setOpenSearchUrl
(String openSearchUrl) void
setPassword
(String password) void
setProxyHost
(String proxyHost) void
setProxyPort
(int proxyPort) void
setSocketTimeout
(int socketTimeout) void
setUpdateStrategy
(String strategy) void
setUpdateStrategy
(OpenSearchEmitter.UpdateStrategy updateStrategy) void
setUserName
(String userName) Methods inherited from class org.apache.tika.pipes.emitter.AbstractEmitter
getName, setName
-
Field Details
-
DEFAULT_EMBEDDED_FILE_FIELD_NAME
-
-
Constructor Details
-
OpenSearchEmitter
- Throws:
TikaConfigException
-
-
Method Details
-
emit
Description copied from class:AbstractEmitter
The 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:
emit
in interfaceEmitter
- Overrides:
emit
in classAbstractEmitter
- Throws:
IOException
TikaEmitterException
-
emit
public void emit(String emitKey, List<Metadata> metadataList, ParseContext parseContext) throws IOException, TikaEmitterException - Specified by:
emit
in interfaceEmitter
- Throws:
IOException
TikaEmitterException
-
setAttachmentStrategy
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.CONCATENATE
in yourFetchEmitTuple
or in the <parseMode> element in yourPipesIterator
configuration. -
setConnectionTimeout
-
setSocketTimeout
-
getCommitWithin
public int getCommitWithin() -
setCommitWithin
-
setIdField
Specify the field in the first Metadata that should be used as the id field for the document.- Parameters:
idField
-
-
setOpenSearchUrl
-
setUserName
-
setPassword
-
setAuthScheme
-
setProxyHost
-
setProxyPort
-
setUpdateStrategy
-
setUpdateStrategy
- Throws:
TikaConfigException
-
setEmbeddedFileFieldName
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
- Specified by:
initialize
in interfaceInitializable
- Parameters:
params
- params to use for initialization- Throws:
TikaConfigException
-
checkInitialization
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException - Specified by:
checkInitialization
in 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
-