Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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

avatar
New Member

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
Master 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
Master 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
Master Collaborator

@David Lam did this work for you?