Extending woocommerce admin product search

I solve this problem it’s too easy just paste the code in functions.php and the code do not remove the default searching by title.

See The Example with screenshots

First, add your Custom Field Group with Post Type is equal to Product and add a new field with field label and field name as like

adding custom

Add some text in the custom field that shows in the product edit page

editing in product page

In the last step just add the code in function.php and separate your
field names by commas in array $custom_fields = array("_product_test");

function search_by_custom_field_for_admin( $search, &$wp_query ) {
    global $wpdb, $pagenow;
    $post_type="product";
    $custom_fields = array(
        "_product_test",
    );

    if ( 'edit.php' != $pagenow || !is_admin() || $wp_query->query['post_type'] != $post_type ) {
        return $search;
    }

    $get_post_ids = array();
    foreach ($custom_fields as $custom_field_name) {
        $args = array(
            'posts_per_page'  => -1,
            'post_type'       => $post_type,
            'meta_query' => array(
                array(
                    'key' => $custom_field_name,
                    'value' => $wp_query->query['s'],
                    'compare' => 'LIKE'
                )
            )
        );
        $posts = get_posts( $args );
        if(!empty($posts)){
            foreach($posts as $post){
                $get_post_ids[] = $post->ID;
            }
        }
    }
    $wp_query->set('post__in', $get_post_ids);
    return $search;
}
add_filter( 'posts_search', 'search_by_custom_field_for_admin', 999, 2 );

After changes, you can see the searching results in the screenshot

after changes