Define anchors for content records without indexing corresponding headlines?

I have a page which lists a lot of command-line options of a program, using <h2> for option categories and <h3> for the option names, like so:

<h2>backup</h2>

<h3>--backup.api-enabled</h3>
<p>Description...</p>

<h3>--backup.files-per-batch</h3>
<p>Description...</p>

<h2>cache</h2>

<h3>...</h3>
<p>...</p>
...

The problem is that there are almost 500 options + categories. Algolia would create this many records for the headlines alone, and then another record for each option, bringing it over the limit of 750 records. Splitting the page is not an option as it would harm usability and require non-trivial, undesired changes to the tooling as the content is generated.

To work around the record limitation, I tried to not index the headlines but only the content. I still need the option names to be searchable, so I used cheerio to get the text from the <h3> headlines and prepend it to the content.

      recordExtractor: ({ $, helpers }) => {
        // ...
        const startupOptionHeadlines = $("h3");
        startupOptionHeadlines.each(function() {
          const optionName = $(this).text();
          $(this).after(`<p id="${$(this).attr("id")}">${optionName}</p>`);
        });

This seems to work, but the problem is that the indexed URLs do not have the right anchors. I even tried to get the <h3> ID and apply is to the <p> element I prepend in the hope that the crawler would pick this anchor up. However, the lvl3 record entries are not set (because I don’t index the <h3> headlines) and anchor is always the <h2> fragment identifier. This means searches won’t end up in the right place but only at the option category headline.

Is there a way to manually specify the value for lvl3 respectively override anchor?