@Override public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) { SolrUIMAConfiguration configuration = new SolrUIMAConfigurationReader(args) .readSolrUIMAConfiguration(); synchronized (this) { if (ae == null && pool == null) { AEProvider aeProvider = AEProviderFactory.getInstance().getAEProvider( req.getCore().getName(), configuration.getAePath(), configuration.getRuntimeParameters()); try { ae = aeProvider.getAE(); pool = new JCasPool(10, ae); } catch (ResourceInitializationException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e); } } } return new UIMAUpdateRequestProcessor(next, req.getCore().getName(), configuration, ae, pool); }
/** * analyzes the tokenizer input using the given analysis engine * <p/> * {@link #cas} will be filled with extracted metadata (UIMA annotations, feature structures) * * @throws IOException If there is a low-level I/O error. */ protected void analyzeInput() throws ResourceInitializationException, AnalysisEngineProcessException, IOException { if (ae == null) { ae = AEProviderFactory.getInstance().getAEProvider(null, descriptorPath, configurationParameters).getAE(); } if (cas == null) { cas = ae.newCAS(); } else { cas.reset(); } cas.setDocumentText(toString(input)); ae.process(cas); }
private void initialize(SolrCore solrCore, SolrUIMAConfiguration config) { this.solrCore = solrCore; solrUIMAConfiguration = config; aeProvider = AEProviderFactory.getInstance().getAEProvider(solrCore.getName(), solrUIMAConfiguration.getAePath(), solrUIMAConfiguration.getRuntimeParameters()); }