Last active
October 20, 2015 15:06
-
-
Save algotrader-dotcom/82c2166dcfc000bc5d5b to your computer and use it in GitHub Desktop.
Drupal 7: Add custom field indexed in Apache Solr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| function mymodule_apachesolr_index_document_build_node(ApacheSolrDocument $document, $entity, $env_id) { | |
| if ($entity->type == 'company'){ | |
| $node_field_address = $entity->field_address['und'][0]['value']; | |
| // Add the image and description to the document in the solr index. | |
| $document->addField('ts_company_add', $node_field_address); | |
| } | |
| } | |
| ... | |
| # REf | |
| http://www.drupalwoo.com/content/blog/adding-custom-field-solr-search-index-drupal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment