<?php
// Index indivisual ACF location values to allow searching by street.
add_filter( 'facetwp_index_row', function( $params, $class ) {
// Update "search_address" to the slug of the facet.
if ( 'search_address' == $params['facet_name'] ) {
$details = $params['place_details'];
// Update this to whatever string you would like to index for search.
// FacetWP saves all ACF Map data in place_details $params.
$location = $details['street_number'] . ' ' . $details['street_name'] . ', ' . $details['city'] . ', ' . $details['state'] . ' ' . $details['post_code'];
$params['facet_value'] = $location;
$params['facet_display_value'] = $location;
}
return $params;
}, 10, 2 );