I read the note about Apache Solr Multilingual Drupal 7 that says it will not be released until core translation issues are resolved. That being said will this module work for a basic Drupal 7 multilingual site. (In my case English and French) I have Apache Solr Integration module up and running but with this module enabled / configured I cannot seem to make it filter on language. (I have re-index all documents.) Do you need to change anything with your Solr install to get it to work? Please let me know if you have this module working with Drupal 7. Thanks and any help is much appreciated.

Comments

joel_osc’s picture

At first this seemed like an odd case, but in looking at it I think it is a good question. From the code I don't this module will do much since I don't think this hook exists in D7:

/**
 * Implements hook_apachesolr_modify_query().
 */
function apachesolr_multilingual_apachesolr_modify_query(&$query, $caller) {
  global $language;

I think it is now:

hook_apachesolr_query_alter

joel_osc’s picture

One quick workaround to limit the query to the user's language is to add this to your site module:

function mymodule_apachesolr_query_alter($query) {
  global $language;
  $query->addFilter('ss_language', $language->language);
}
mkalkbrenner’s picture

I'm thinking about an Apache Solr Multilingual code sprint at Drupal Con Munich. Anyone interested?

nick_vh’s picture

I'm very interested! Please organise :)

cheyer’s picture

thanks a lot #2 for this small code, it works like a charm and it saved me a lot of time. big thumbs.

mkalkbrenner’s picture

Status: Active » Closed (duplicate)