I'm working on a module that will retrieve data (search results) from an external web service and then display them, preferably in some sort of nicely themed way. I'm very new to drupal though, so i don't really know what the "right" approach is. I can get the external data without any problems, and have been experimenting with Views (1.6) and CCK - i've created a new search result content type, a view to display the results, and have implemented hook_views_pre_view. The general idea is to somehow get Views to skip the DB access (or to ignore the fact that it doesn't return anything), and to pass it an array of programatically created search result nodes instead. So far i haven't been having much success...

Is it possible to do this sort of thing with views? Any ideas or pointers would be very much appreciated!

Comments

jayjaydluffy’s picture

Are you using Solr for searching? I prefer you gonna develop this module with Solr as backend. Use the apachesolr module to communicate drupal and your solr instance. If you are using only the core search, you might want to use views_fastsearch, which is the one you might be looking for. I'm also doing right now views-apachesolr integration module, but like you, i'm not having much success.. Please post often so we could help each other.
Thank you so much.

pbriggs’s picture

Thanks for the suggestions, but unfortunately i'm not using Solr or core drupal search - i'm working with the JSON output of a custom webapp. I've pretty much abandoned the approach i was taking at this stage though. Best of luck with your Solr integration troubles - i know how it feels!

dwightaspinwall’s picture

Hi pbriggs, I have a situation similar to yours perhaps. Want to create node types which are essentially proxies for data which resides in a legacy db (in our case it happens to be mysql as well). Yet, I'd also like to let my users access the views module to query subsets of those nodes (as if they were plain old nodes). So far no luck understanding how this might be done.

Can you share where your research led you and why you abandoned your approach? Thanks in advance.

mackstar’s picture

I am trying to get json data and inject into my drupal site also, I have been able to inject this into a dummy node without too much trouble. But I am really struggling to feed it into views as it seems so database dependant...

Any help is appreciated..

Richard