FacetWP schedule a one-time WP-Cron event to re-index a single post

// Schedules a one-time event to programmatically re-index a single post.
// See this section for how to programmatically schedule one-time re-indexing of all, or a selection of posts:
// https://facetwp.com/help-center/indexing/#trigger-one-time-re-indexing-with-wp-cron
// For periodic, recurring re-indexing, see our Schedule Indexer add-on:
// https://facetwp.com/help-center/add-on-features-and-extras/schedule-indexer/
// To do this for a full re-index, see: https://gist.facetwp.com/gist/facetwp-schedule-a-one-time-wp-cron-event-to-re-index-all-posts/

// Needs to be availble for WP Cron to run
function fwp_single_index( $post_id ) {
    FWP()->indexer->index( $post_id );
add_action( 'fwp_single_index', 'fwp_single_index' );

// Place this in a hook or function where you want to initiate indexing, for example after finishing an import.
wp_schedule_single_event( time(), 'fwp_single_index', array( 456 ); // Re-indexes postID 465. Don't add more than one post ID to the array, that will NOT work. See the above link.