Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to call a SOAP web service from within a solr updateRequestProcessorChain?

Solved Go to solution

How to call a SOAP web service from within a solr updateRequestProcessorChain?

New Contributor

I have a SOAP web service setup to annotate text using UIMA-nlp, how would I be able to use updateRequestProcessorChain to call this web service?

Thanks,

David

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to call a SOAP web service from within a solr updateRequestProcessorChain?

Super Collaborator

@David Lam

I believe that would be pretty straight forward.

1) Write your SOAP client

2) Integrate it a custom class which extends UpdaterequestFactory in the processAdd(AddUpdateCommand) method.

3) Create your updateRequestProcessorChain in the solrconfig.xml

4) Add the chain to a requestHandler

Look at the example here for the ConditionalCopyProcessorFactory but just make your SOAP call instead.: https://wiki.apache.org/solr/UpdateRequestProcessor

In the processAdd, since you have access to the SolrInputDocument, you can get any field's value and you can also add a new field or child document, which is just another SolrInputDocument.

Be aware that by doing this you could add a bottleneck to your update pipeline if the web service is slow or down and you could also add additional stress on the Solr server, which perhaps is also serving queries. It just depends on your load and other factors. Alternatively, you could annotate the SolrDocuments in your ingest pipeline, before they are sent to Solr to push the load elsewhere. If you have no control over the ingest pipeline, you may have to do it in the update request chain anyway.

2 REPLIES 2

Re: How to call a SOAP web service from within a solr updateRequestProcessorChain?

Super Collaborator

@David Lam

I believe that would be pretty straight forward.

1) Write your SOAP client

2) Integrate it a custom class which extends UpdaterequestFactory in the processAdd(AddUpdateCommand) method.

3) Create your updateRequestProcessorChain in the solrconfig.xml

4) Add the chain to a requestHandler

Look at the example here for the ConditionalCopyProcessorFactory but just make your SOAP call instead.: https://wiki.apache.org/solr/UpdateRequestProcessor

In the processAdd, since you have access to the SolrInputDocument, you can get any field's value and you can also add a new field or child document, which is just another SolrInputDocument.

Be aware that by doing this you could add a bottleneck to your update pipeline if the web service is slow or down and you could also add additional stress on the Solr server, which perhaps is also serving queries. It just depends on your load and other factors. Alternatively, you could annotate the SolrDocuments in your ingest pipeline, before they are sent to Solr to push the load elsewhere. If you have no control over the ingest pipeline, you may have to do it in the update request chain anyway.

Re: How to call a SOAP web service from within a solr updateRequestProcessorChain?

Super Collaborator

@David Lam did this work for you?

Don't have an account?
Coming from Hortonworks? Activate your account here