Custom filter post by tags but change by custom name ex.genre

Please help me, i can change this code for genre not tags

Ex

title: example title
genre: action comedy horror

{% assign alldocs = site.series | %}
{% assign grouptag = alldocs | map: ‘tags’ | join: ‘,’ | split: ‘,’ | group_by: tag %}
{%- for tag in grouptag -%}

{{- tag.name -}} - {{tag.size}}


{%- for document in alldocs -%}
{% if document.tags contains tag.name %}

{{- document.title -}}


{% endif %}
{%- endfor -%}
{%- endfor -%}