Customize attributes when using docsearch scraper

We use docsearch scraper to index our documentation website.
Our site is partitioned into different products, each with its own versioning:
https://docs.example.com/component/version/

When the version field has the string current, the website automatically shows the latest version. For example, if the most recent version is 5, then the site shows version five at https://docs.example.com/component/current.

We’d have the following code in our scraper as a start url:

{
      "url": "https://docs.example.com/(?P<component>.*?)/(?P<version>.*?)/",
      "variables": {
        "component": [
          "server", "lang-ref", "gui"
        ],
        "version": [
          "2",
          "3",
          "4",
          "current"
        ]
      }
    }

If we do it this way, then the records of the most current version will have attribute "version:current", which is not what I want. I want the actual version number 5 to be there. Is there any way for me to achieve this?

I was able to solve my own problem. There is an extra_attributes field that you can supply when you supply the start URL. This is not documented anywhere as far as I know - I had to find it in someone else’s implementation of docsearch, but it worked for me.