By johnpv on
I'm wondering how I can modify the search module to perform an additional search of an external server. Our site consists of the Drupal installation for all of our content and then an ecommerce portion on another server. I want to send the keywords that a user inputs on the Drupal side to the external server (while also searching Drupal), my hope is to get an XML file back with the results, parse them and display on the search results page along with the Drupal content.
Any ideas of where I can start?
Thanks.
Comments
Havent' done it in Drupal, but ...
I've done similar things outside of drupal by implementing a SOAP service to provide searching capabilities on the external server then making use of that service from the local machine and combining the result sets prior to display. The Services module would be a help handling that.
The other thing you might be able to do, if the external server won't/cant allow SOAP searching, is submit the search to the external server using cURL. That'll just get you the output page that server would return if you had searched on their site directly. It's a big hassle because then you have to try to parse the html to get just the parts you're interested in, but it's doable.
It may not be exactly what
It may not be exactly what you're looking for, but there's a section in the Pro Drupal Development book which covers indexing data in a legacy database - you would index the legacy content using Drupal and then link to the legacy system in the Drupal search results page. It uses hook_update_index to create the index and hook_search to display the results. I've no affiliation to the book or its authors but it might be worth a look.
Thanks for the leads. One
Thanks for the leads. One more question, what would be the best way to modify the search form? I'll want the regular Drupal search to function as usual, but there needs to be that extra call or action to the other server, how would the search be modified accordingly?
Thanks.