Hello,

I try to add a field in the schema.xml and can't make it work.
I added a line and when I try to see it on my solr server the new field was never add in the xml response that I get.
ex: http://localhost:8080/solr/select?response

(I've restarted the server after the schema.xml modification)

Something else to change ???

Thank you!

Comments

anarchivist’s picture

You need to modify the solrconfig to return the field by default - in addition, though, it's likely that apachesolr (i.e., the Drupal module) won't see this because it requests a specific set of fields from the Solr server.

briandorval2’s picture

I've take a look at the solrconfig.xml and there's no configuration for any fields.

Do you have any idea where the fields requested by the drupal module are set ?
(I know it's not the best way tweaking the drupal directly in the code but I'm running out of time)

Thanks!

pwolanin’s picture

in apachesolr_search.module:


function apachesolr_search_basic_params($query) {
  $params = array(
    'fl' => 'id,nid,title,comment_count,type,created,changed,score,path,url,uid,name',
    'rows' => variable_get('apachesolr_rows', 10),
    'facet' => 'true',
    'facet.mincount' => 1,
    'facet.sort' => 'true'
  );
  return $params;
}

It's easy to add to this however, see, for example, the apachesolr_image.module hook implementation:


/**
 * Implementation of hook_apachesolr_modify_query().
 */
function apachesolr_image_apachesolr_modify_query(&$query, &$params) {
  // Also retrieve image thumbnail links.
  $params['fl'] .= ',ss_image_relative';
}

briandorval2’s picture

Thx for your help, I'll take a look at it!

robertdouglass’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.