Data attributes for inclusion and exclusion are not working

I've implemented the "data-elastic-exclude" attribute in the body tag and "data-elastic-include" in specific content sections to ensure that only those parts are indexed by Elasticsearch web crawler. However, it appears that this functionality isn't functioning as expected. Despite these attributes, the web crawler is gathering all content within the body, including navigation, sidebar, and footer elements. Are there any specific requirements or considerations I should be aware of when using "data-elastic-exclude" and "data-elastic-include"? Can I exclude header and footer at least from body_content?

Here's the relevant code snippet:

<body data-elastic-exclude data-paywall-content-type="premium">
   ...
   <section data-elastic-include class="content article-content">
        {{ article.content|safe }}
   </section>
   ...
</body>