1

What I want to do is use the built in search engine I currently have running in my Drupal site, but allow another site to use that same search engine. Basically a legit copy and paste of the form code.

The reason being is I have a separate web application that is running and I am copying the exact look and feel of the Drupal site to make it seem as if the web application is part of the web site. It's separate because the functionality would be a pain to implement in Drupal, and I could do it in Rails in 30 minutes.

So, what things do I need to configure in Drupal and in my web application to make this happen?

EDIT: Just to clarify, my external web application is not consuming any data from Drupal what-so-ever. All I want to do is POST the "copied" search form to the Drupal engine and have it render the search results as if you had searched directly from the Drupal site. It seems like the Services module is used to streamline data to external web applications, and that is not the workflow here at all.

EXAMPLE: Say I have my Rails application sitting at http://app.hostname.com/ and my Drupal site sitting at http://hostname.com/. There is a search form at the root of my Rails application that is pretty much a copy paste of the browser code you'd see as if you had looked at the Drupal site source of the search form. It's just a simple text box with a submit button. When I submit that form from the Rails site, I want it to POST the data to the Drupal site and have the returned results be the exact same as if I had searched from the Drupal site directly (I said this already but it doesn't hurt to re-iterate), leaving the URL bar now saying http://hostname.com/search/node/foo%20bar.

2

Drupal searches can just be normal GET requests w/o going through the form. Try it.

Make a page in your RoR app to catch the POST and parse the search needle. Then 302 to the Drupal site with the proper URL.

| improve this answer | |
  • That is way awesome. Super simple. You know I should have realized that when I added onto my question with that example there, with the URL I provided at the end there... oops. Thanks. – Lester Peabody Sep 8 '11 at 20:59
  • Should also mention that you can attach some jQuery to your RoR form, and do the same thing. This cuts down on latency, but you also have your fallback if users have JS disabled. – mpdonadio Sep 9 '11 at 1:30
0

You could use the Services module. Please see: Services: An API for remote applications

Services is a standardized API for Drupal that allows you to create "services", or a collection of methods, intended for consumption by remote applications

| improve this answer | |
  • I don't think this is what I'm looking for unfortunately, I have updated my question to reflect what I need to happen. Thanks. – Lester Peabody Sep 8 '11 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.