@Override protected void doProcess(JCas jCas) throws AnalysisEngineProcessException { Map<String, Object> json = SingleDocumentConsumerFormat.formatCas( jCas, fields, contentHashAsId, getMonitor(), getSupport()); String id = (String) json.getOrDefault("externalId", ""); // Persist to ElasticSearch addDocument(id, json); }
@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException { boolean indexCreated = createIndex(); if (indexCreated) { try { addMapping(createMappingObject()); } catch (IOException ioe) { getMonitor() .error( "Unable to create mapping, you may get unexpected results in your Elasticsearch index", ioe); } } }