Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
Explorer

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

avatar
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.

View solution in original post

2 REPLIES 2

avatar
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.

avatar
Super Collaborator

@David Lam did this work for you?