Currently 'bundle' is not a required field in schema.xml. However the apachesolr module does sometimes assume that a bundle is always available. Even though the apachesolr module makes sure that a bundle is always added, this isn't always the case - for example when content gets added to Solr by Nutch.
One such occurrence is in the apachesolr_search.module:
$snippet = theme('apachesolr_search_snippets__' . $doc->entity_type . '__' . $doc->bundle, array('doc' => $doc, 'snippets' => $snippets));
Because the schema.xml might still change, I'm just reporting this as something that we might want to take into consideration in future discussion.
Comments
Comment #1
pwolanin commentedAh, good point.
Perhaps we should make it like this?
Comment #2
wmostrey commentedThat would be a good start yes. I found some interesting things when crawling a non-Drupal site using Nutch. Only having the bare minimum fields (I believe they're id, entity_id, entity_type, label, content, site, url (and hash for apachesolr_multisitesearch)) throws a couple of notices. The Apache Solr module provides more fields to Solr, and it expects them to be there as well. Bundle is one such example, path is another.
Comment #3
pwolanin commentedPer other discussion (IRC?) this patch makes entity_id optional in the schema, and tries to avoid notices by setting to NULL any missing field listed in the 'fl' param.
Comment #4
wmostrey commentedThese are great additions, and things work as expected. As far as I'm concerned this is good to go, unless you want to wait for one extra review.
Comment #5
pwolanin commentedcommitted