Search results not displaying properly

transformative - March 23, 2009 - 13:50
Project:Multisite Search
Version:5.x-1.0
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:comments, multisite search, search results
Description

When I do a multisite search, the results it gives me look like this:

Search results

...

- comments

...

- comments

...

When I do a regular (non-multisite) search, I get the correct results.

So, let's say I search for "win" on multisite.example.com. In a regular search, I get 3 results, and it shows them to me formatted properly. When I search for "substantially" on multisite.example.com/site1, I get 4 results, and it shows them to me formatted properly.
However, when I search for "win" or "substantially", using the multisite search on either of the sites, all I get is this "... - comments". It does, however, give me the correct number of results.

Has anyone else run into this problem? Is this a problem with my setup, somewhere, or is there a problem with the module??

I've tried changing my theme back to Garland, in case it was an issue somewhere with the html.

Here is my setup:

Multisite Configuration
Site id Table prefix Site URL Operations
4 www_ http://multisite.example.com delete
5 site1_ http://multisite.example.com/site1 delete
6 site2_ http://multisite.example.com/site2 delete

In my codebase:
sites/default
sites/multisite.example.com.site1
sites/multisite.example.com.site2

In my Database:
www_sessions ( with $db_prefix = array('default' => 'www_',)
site1_sessions
site2_sessions

Thanks for the module!

...
Kevin.

#1

transformative - July 3, 2009 - 14:03

I fixed this. I believe this was my fix:

At line 420 of the module, there was a line that looked like this:

<?php
$node
= db_fetch_object(db_query("SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM ".$tbl_prefix."node n INNER JOIN ".$tbl_prefix."users u ON u.uid = n.uid INNER JOIN ".$tbl_prefix."node_revisions r ON r.vid = n.vid WHERE n.nid=%d", $item->sid));
?>

In my multisite installation, the users table is a shared table. I had to change the query to use shared_users, rather than $tbl_prefix."users. Ideally, perhaps I could have used a function to figure out what the appropriate users table is for the installation, but I just hard-coded it in the query:

<?php
$node
= db_fetch_object(db_query("SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM ".$tbl_prefix."node n INNER JOIN shared_users u ON u.uid = n.uid INNER JOIN ".$tbl_prefix."node_revisions r ON r.vid = n.vid WHERE n.nid=%d", $item->sid));
?>

 
 

Drupal is a registered trademark of Dries Buytaert.