Basically, here's what I want to do:
I want to have a custom node type where each node is a simple directory listing (e.g., name, category, address, phone) that can be easily pulled via SQL from the back-end database of another website.
Then, when somebody enters a search term, I want the results to show results from regular Drupal content (like it does now), followed by specially formatted results from this new custom node type.
As part of this, the directory data from this other site would need to be indexed so that the name and category could be matched to the search term with the highest degree of performance.
Is this possible with Drupal, in combination with particular modules (if needed)? Or would I need to do a lot of custom programming to achieve this? At any rate, what would be a good approach for me to follow?
Thanks!
Comments
Part of the question is how
Part of the question is how you want to pull this data, as a periodic import or in real time. As an import the data needs to be keyed when do an update (importing again). Do it in real time would probably be slow.
In general though you could import the data into a node. A couple of choices, 1) pull the data, format as desired and place the formatted information in the body of a node. Or have a custom or CCK node with fields that are a subset of the data being imported and import the data in to the respected fields. In this case you would need to format the node on output.
Not sure about the point about needing to be indexed.
Since this requires reading a non Drupal database you are going to need a custom module at least for pulling the data.
Thanks for the ideas
In the scenario we're talking about, I am thinking that instead of creating a custom module for pulling the data, which might need intervention by an admin, I would instead create a cron job that runs periodically and pulls/updates the directory data. And the data would be stored in a custom/CCK node with correlating fields.
But that scenario may be needlessly complicated. On further thinking about this since my first post, as the directory data is somewhat limited and low-growth in its volume, I may just do a query from the directory database on the fly when somebody does a search, and just dump its results (with its own format) following the standard search results. This would be the most straightforward approach, I'm thinking. I would have a theme-based version of search_view().
Does that sound workable?
Steve Magruder - http://www.webcommons.biz