[ 
https://issues.apache.org/jira/browse/SOLR-7760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14643287#comment-14643287
 ] 

Aaron LaBella commented on SOLR-7760:
-------------------------------------

Yes, I wrote a UimaSearchHandler that extends SearchHandler to do "adhoc" uima 
analysis.  It is configured to reference the same updateRequestProcessorChain 
that is used during index time but in order to generically know what fields to 
return I need public access to the SolrUIMAConfiguration and fieldMappings.  I 
don't have time to write a testcase, but, here's some sample code that uses it:

{code:java}
          UpdateRequestProcessorChain chain = 
req.getCore().getUpdateProcessingChain(uimaChain);
          List<UpdateRequestProcessorFactory> processors = 
chain.getProcessors();
          UpdateRequestProcessorFactory factory = processors.get(0);
          UpdateRequestProcessor processor = factory.getInstance(req, null, 
null);

          SolrUIMAConfiguration conf = 
((UIMAUpdateRequestProcessor)processor).getConfiguration();
          Map<String, Map<String, MapField>> map = 
conf.getTypesFeaturesFieldsMapping();
          for(Map.Entry<String,Map<String,MapField>> entry : map.entrySet())
          {
            String annotationClass = entry.getKey();
            annotationClasses.add(annotationClass);
          }
{code}

> Fix method and field visibility for UIMAUpdateRequestProcessor and 
> SolrUIMAConfiguration
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-7760
>                 URL: https://issues.apache.org/jira/browse/SOLR-7760
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - UIMA
>    Affects Versions: 5x
>            Reporter: Aaron LaBella
>            Priority: Critical
>             Fix For: 5.3
>
>         Attachments: SOLR-7760.patch
>
>
> The methods in 
> {{solr/contrib/uima/src/java/org/apache/solr/uima/processor/SolrUIMAConfiguration.java}}
>  are not public and they need to be for other code to be able to make use of 
> the configuration data, ie: mapped fields.   Likewise, 
> {{solr/contrib/uima/src/java/org/apache/solr/uima/processor/UIMAUpdateRequestProcessor.java}}
>  does not have an accessor for the SolrUIMAConfiguration object



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to