SELECT COUNT(*)::bigint AS total
FROM invima_api_catalog
WHERE (
  to_tsvector('spanish', COALESCE(search_text, '')) @@ websearch_to_tsquery('spanish', 'marcapasos')
  OR COALESCE(registro_sanitario, '') ILIKE '%marcapasos%'
  OR COALESCE(expediente, '') ILIKE '%marcapasos%'
  OR COALESCE(producto, '') ILIKE '%marcapasos%'
  OR COALESCE(categoria_canonica, '') ILIKE '%marcapasos%'
  OR COALESCE(categoria_linea, '') ILIKE '%marcapasos%'
);
