When the option "Limit search to user's language by default" is enabledon Apache Solr Multilingual config screen, results highlighting doesn't work and is always empty.
When the option is enabled, the hl.fl parameter (ie. $params['hl.fl']) for the query is modified to body_$filter_language by apachesolr_multilingual_apachesolr_modify_query() invoked from apachesolr_do_query() and itself invoked from apachesolr_search_execute(). The $param parameter of apachesolr_do_query() is passed by value and is not returned (unlike the query passed in the $current_query parameter). So when the response is processed by apachesolr_process_response() (invoked from apachesolr_search_execute()), $params['hl.fl'] is used to retrieve the highlighting but it hasn't been altered. Thus highlighting in the response is not seen because of the mismatch between the field name used in the response and the value of $params['hl.fl'].
Comments
Comment #1
mkalkbrennerPlease read the release notes of 6.x-1.0-beta3 at http://drupal.org/node/900642
It's not our fault.
This patch has been committed to CVS but unfortunately it has not been released yet. But you can try the dev version of apachesolr 6.x-1.x: http://drupal.org/node/259285
Comment #2
wouters_f commentedI was so lucky to have found where the problem was and fixed it.
Only so much later I found this post.
At least I know how the apachesolr module works from the inside out now.