public class OpenSearchEmitter extends AbstractEmitter implements Initializable
Modifier and Type | Class and Description |
---|---|
static class |
OpenSearchEmitter.AttachmentStrategy |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EMBEDDED_FILE_FIELD_NAME |
Constructor and Description |
---|
OpenSearchEmitter() |
Modifier and Type | Method and Description |
---|---|
void |
checkInitialization(InitializableProblemHandler problemHandler) |
void |
emit(List<? extends EmitData> emitData)
The default behavior is to call
Emitter.emit(String, List) on each item. |
void |
emit(String emitKey,
List<Metadata> metadataList) |
int |
getCommitWithin() |
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 the
OpenSearchEmitter.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 |
setUserName(String userName) |
getName, setName
public static String DEFAULT_EMBEDDED_FILE_FIELD_NAME
public OpenSearchEmitter() throws TikaConfigException
TikaConfigException
public void emit(List<? extends EmitData> emitData) throws IOException, TikaEmitterException
AbstractEmitter
Emitter.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.emit
in interface Emitter
emit
in class AbstractEmitter
IOException
TikaEmitterException
public void emit(String emitKey, List<Metadata> metadataList) throws IOException, TikaEmitterException
emit
in interface Emitter
IOException
TikaEmitterException
@Field public void setAttachmentStrategy(String attachmentStrategy)
HandlerConfig
's parseMode to
HandlerConfig.PARSE_MODE.CONCATENATE
in your FetchEmitTuple
or in the
<parseMode> element in your PipesIterator
configuration.@Field public void setConnectionTimeout(int connectionTimeout)
@Field public void setSocketTimeout(int socketTimeout)
public int getCommitWithin()
@Field public void setCommitWithin(int commitWithin)
@Field public void setIdField(String idField)
idField
- @Field public void setProxyPort(int proxyPort)
@Field public void setEmbeddedFileFieldName(String embeddedFileFieldName)
OpenSearchEmitter.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.embeddedFileFieldName
- public void initialize(Map<String,Param> params) throws TikaConfigException
initialize
in interface Initializable
params
- params to use for initializationTikaConfigException
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException
checkInitialization
in interface Initializable
problemHandler
- if there is a problem and no
custom initializableProblemHandler has been configured
via Initializable parameters,
this is called to respond.TikaConfigException
Copyright © 2007–2022 The Apache Software Foundation. All rights reserved.