facetwp index only one post type

<?php
/** check the post type and return false if its not the post type we
 ** want to index for this filter 
 **/

add_filter( 'facetwp_index_row', function( $params, $class ) {
	if ( 'collections_filter' == $params['facet_name'] && 'collection' != get_post_type( $params['post_id'] ) ) {
		$params['facet_value'] = ''; // skip indexing
	}
	return $params;
}, 10, 2);