Skip to content

Instantly share code, notes, and snippets.

@ataylorme
Created June 28, 2018 17:39
Show Gist options
  • Save ataylorme/55bb0ba93026f1c43af4487aaa61efae to your computer and use it in GitHub Desktop.
Save ataylorme/55bb0ba93026f1c43af4487aaa61efae to your computer and use it in GitHub Desktop.
Solr Power Custom Field Filter Example
<?php
function filter_solr_index_custom_fields( $facet_on_custom_fields ) {
$car_custom_fields = array(
'vehicle_cylinders',
'vehicle_drive_type',
'vehicle_fuel_type',
'vehicle_transmission',
'vehicle_year',
);
return array_merge( $facet_on_custom_fields, $car_custom_fields );
}
add_filter( 'solr_index_custom_fields', 'filter_solr_index_custom_fields', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment