Regarding the re-index, yeah that sounds about right where the searchable index kind of has its own bulk spot for one button. However the Autocomplete indexes in Algolia are separated out and you have to click the individual re-index button on the Autocomplete settings page.
Regarding the code snippets, note that the example from Darren at https://webdevstudios.com/2021/02/09/wp-search-with-algolia/#indexing-custom-fields includes a foreach on the array of fields to fetch.
You’d need to modify your first example to be closer to:
$fields = [
'field_1',
'field_2',
'field_3',
'field_4',
];
foreach( $fields as $field ) {
$data = get_field( $field, $post->ID );
if ( ! empty( $data ) ) {
$attributes[ $field ] = $data;
}
}
Regarding the searchability aspect, which I assume you’re referring to https://community.algolia.com/wordpress/advanced-custom-fields.html#make-custom-fields-searchable for, you would need to click the “Push settings” buttons to get that information known to your Algolia instance. That information can also be configured in the Algolia Dashboard, if preferring a UI for it.