I'm in the process of converting my website to use Drupal. I have a lot of content in a table (expected eventually to number in the hundreds of thousands if not more) that I'd like to include in drupal's search indexing (so that I can get rid of the hacked together search that I have currently, and have one search that searches everything on the site -- forums, blogs, etc). However, I don't want to include this content in the drupal_node table. That table's just not rich enough for my needs. Is it possible to point drupal's search engine at other parts of the site, and have one search that searches both the _node table (forums, etc) as well as my site-specific table?

Comments

Steven’s picture

The indexed search occurs in a single set. In the case of nodes, the node metadata is used (e.g. published status or node access) during search, so you can't insert non-nodes into the set and have it work.

However, I don't get your "node table not rich enough" argument: you are free to load and store data anywhere you want. Search indexes your nodes as they are displayed (not just the data in the node table) and you can even add non-visible data to be indexed as well. Plenty of node types have their own table and are just as searchable.

--
If you have a problem, please search before posting a question.

Wesley Tanaka’s picture

Has anyone tried putting millions of nodes into the node table?

So the idea is to use only the "nid" and "type" columns of the node table, and some of the date fields, and join that with my own application table (on nid) when I need to get the actual data out? In particular, ignore the "title", "body", "teaser" and "revisions" columns completely?

would that work?

handelaar’s picture

In fact that's more or less exactly how you make a new node module. Start with node-example.module and read up on hook_search() and you'll be set.

Help is available in the module dev forum here once you get started :)

sin’s picture

I want to change default behaviour of Drupal search system using search.module and do not know from where to start.

I want to use my own content type which is NOT using Drupal nodes but stored in a separate database in some tables. I want objects of this type be searchable through standard Drupal search module/block and appear in a search results among other node based content. In my module for that content type I implemented hook_search. As a result I got a separate tab for my content type searching under /search. And when I search through standard search block form I search only nodes.

The idea is to have one page for all search results based on keyword search and separate search tabs for advanced search on each content type.

Now I have 2 questions:
1. How to enable non node content to show in a search results of Drupal's keyword search (in the same tab with blog posts, flexinodes ets.) without creating additional dummy nodes?
2. How to put advanced search form (with additional fields) for my content type on a tab under /search?

Thanks for any help.

sin’s picture

I posted my solution at http://drupal.org/node/80636