public class SolrEmitter extends AbstractEmitter implements Initializable
Modifier and Type | Class and Description |
---|---|
static class |
SolrEmitter.AttachmentStrategy |
static class |
SolrEmitter.UpdateStrategy |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EMBEDDED_FILE_FIELD_NAME |
Constructor and Description |
---|
SolrEmitter() |
Modifier and Type | Method and Description |
---|---|
void |
checkInitialization(InitializableProblemHandler problemHandler) |
void |
emit(List<? extends EmitData> batch)
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: SKIP, CONCATENATE_CONTENT, PARENT_CHILD.
|
void |
setAuthScheme(String authScheme) |
void |
setCommitWithin(int commitWithin) |
void |
setConnectionTimeout(int connectionTimeout) |
void |
setEmbeddedFileFieldName(String embeddedFileFieldName)
If using the
SolrEmitter.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 |
setPassword(String password) |
void |
setProxyHost(String proxyHost) |
void |
setProxyPort(int proxyPort) |
void |
setSocketTimeout(int socketTimeout) |
void |
setSolrCollection(String solrCollection) |
void |
setSolrUrls(List<String> solrUrls) |
void |
setSolrZkChroot(String solrZkChroot) |
void |
setSolrZkHosts(List<String> solrZkHosts) |
void |
setUpdateStrategy(String updateStrategy) |
void |
setUserName(String userName) |
getName, setName
public static String DEFAULT_EMBEDDED_FILE_FIELD_NAME
public SolrEmitter() throws TikaConfigException
TikaConfigException
public void emit(String emitKey, List<Metadata> metadataList) throws IOException, TikaEmitterException
emit
in interface Emitter
IOException
TikaEmitterException
public void emit(List<? extends EmitData> batch) 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
@Field public void setAttachmentStrategy(String attachmentStrategy)
@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)
SolrEmitter.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–2023 The Apache Software Foundation. All rights reserved.