FacetWp: Add a cutom search engine to search facet

//Add a custom Search Engine to search facet
add_filter('facetwp_facet_search_engines', function( $engines ) {
	$engines['custom_search_engine'] = 'Custom Search Engine';
	return $engines;
}, 10, 2);
	


//Modify the query search args for the custom search engine
function silmax_search_query_args( $search_args, $params ) {
	if($params['facet']['search_engine'] == 'custom_search_engine'){
		$search_args = [
			'posts_per_page' => -1,
			'fields' => 'ids',
		];
		return $search_args;
	}
}
add_filter( 'facetwp_search_query_args', 'silmax_search_query_args', 10, 2 );