It would be nice if you have 'Search settings' available on a per site basis.

On my default site we would like to see all the results of all the sites
On the subsites we would like to only see results for that specific subsite.

It would be even nicer if we could select per site which sites it should show the results.

For example.
default site = everything
site1 = site 1 results
site 2 = site 2 + site 3 results
site 3 = site 3 + site 2 results

If it is already possible in some kind of way please let me know.

Comments

agentrickard’s picture

That would need to be a small independent module. It should be fairly simple to achieve. In D7 you can use hook_node_grants_alter() to change the grants array. In this case, you would do it IFF the path indicates a search.

Something like:

function custom_node_grants_alter(&$grants, $account, $op) {
  $_domain = domain_get_domain();
  $path = arg(0);
  // If not a search path, do nothing.
  if ($path != 'search' || $op != 'view') {
    return;
  }
  // Check the default domain. If so, grant all. 
  // Note that this syntax only works for 7.x.3, in 7.x.2 use domain_default().
  if ($_domain['is_default'])) {
    $grants = array('domain_all' => array(0));
    return;
  }
  // Otherwise, set our rules.
  $domains = domain_get_domains();
  switch ($_domain['domain_id']) {
    case 2:
       // something;
       break;
  }
}

The fun part would be a module that creates a UI for setting these rules. Sounds like a good project for someone to take on.