public abstract class SolrWriter_ImplBase
extends org.apache.uima.fit.component.JCasConsumer_ImplBase
generateSolrDocument()
method to take custom fields into account.
The class initializes a SolrServer instance, and calls generateSolrDocument()
for each
incoming CAS, and adds the result to the Solr server. A commit is executed when all documents are
processed.
Modifier and Type | Field and Description |
---|---|
static String |
PARAM_ID_FIELD
The name of the id field in the Solr schema (default: "id").
|
static String |
PARAM_NUM_THREADS
The number of background numThreads used to empty the queue.
|
static String |
PARAM_OPTIMIZE_INDEX
If set to true, the index is optimized once all documents are uploaded.
|
static String |
PARAM_QUEUE_SIZE
The buffer size before the documents are sent to the server (default: 10000).
|
static String |
PARAM_TARGET_LOCATION
Solr server URL string in the form
<prot>://<host>:<port>/<path> , e.g. |
static String |
PARAM_TEXT_FIELD
The name of the text field in the Solr schema (default: "text").
|
static String |
PARAM_UPDATE
Define whether existing documents with same ID are updated (true) of overwritten (false)?
Default: true (update).
|
static String |
PARAM_WAIT_FLUSH
When committing to the index, i.e.
|
static String |
PARAM_WAIT_SEARCHER
When committing to the index, i.e.
|
Constructor and Description |
---|
SolrWriter_ImplBase() |
Modifier and Type | Method and Description |
---|---|
void |
collectionProcessComplete() |
protected abstract org.apache.solr.common.SolrInputDocument |
generateSolrDocument(org.apache.uima.jcas.JCas aJCas) |
String |
getIdField() |
org.apache.solr.client.solrj.SolrClient |
getSolrClient() |
String |
getTextField() |
void |
initialize(org.apache.uima.UimaContext context) |
void |
process(org.apache.uima.jcas.JCas aJCas) |
boolean |
update()
Perform updates if added documents already exist?
|
getRequiredCasInterface, process
getCasInstancesRequired, hasNext, next
public static final String PARAM_UPDATE
public static final String PARAM_TARGET_LOCATION
<prot>://<host>:<port>/<path>
, e.g.
http://localhost:8983/solr/collection1
public static final String PARAM_QUEUE_SIZE
public static final String PARAM_NUM_THREADS
public static final String PARAM_WAIT_FLUSH
public static final String PARAM_WAIT_SEARCHER
public static final String PARAM_TEXT_FIELD
public static final String PARAM_ID_FIELD
public static final String PARAM_OPTIMIZE_INDEX
public void initialize(org.apache.uima.UimaContext context) throws org.apache.uima.resource.ResourceInitializationException
initialize
in interface org.apache.uima.analysis_component.AnalysisComponent
initialize
in class org.apache.uima.fit.component.JCasConsumer_ImplBase
org.apache.uima.resource.ResourceInitializationException
public void process(org.apache.uima.jcas.JCas aJCas) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
process
in class org.apache.uima.analysis_component.JCasAnnotator_ImplBase
org.apache.uima.analysis_engine.AnalysisEngineProcessException
public void collectionProcessComplete() throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
collectionProcessComplete
in interface org.apache.uima.analysis_component.AnalysisComponent
collectionProcessComplete
in class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
org.apache.uima.analysis_engine.AnalysisEngineProcessException
public boolean update()
public String getTextField()
public String getIdField()
public org.apache.solr.client.solrj.SolrClient getSolrClient()
protected abstract org.apache.solr.common.SolrInputDocument generateSolrDocument(org.apache.uima.jcas.JCas aJCas) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
org.apache.uima.analysis_engine.AnalysisEngineProcessException
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.