title: Woocommerce search the products by title or product tags
body: <p>I am using the code below for search products, but I need to search products only by title or product tags. How I can do it?</p>
  <pre><code>function search_by_title_or_tags( WP_Query $query ): void{
      $search_terms = $query-&gt;get( 's' );
  
      if ( $query-&gt;is_search() ) {
  
          if ( ! $search_terms ) {
               add_action( 'wp', function () use ( $query ) {
               $query-&gt;set_404();
               status_header( 404 );
               nocache_headers();
              } );
          }
  
          $query-&gt;set( 'post_type', array( 'post', 'product' )  );
          $query-&gt;set( 'posts_per_page', SEARCH_GRID_COUNT_ITEMS );
      }
  }
  
  add_action( 'pre_get_posts', 'search_by_title_or_tags' );
  </code></pre>