Created
June 28, 2018 17:39
-
-
Save ataylorme/55bb0ba93026f1c43af4487aaa61efae to your computer and use it in GitHub Desktop.
Solr Power Custom Field Filter Example
This file contains 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
<?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