Need advice for indexing to elasticsearch a Nextcloud instance

Hello Nextclouders,

I would like to create an software that would index all my Nextcloud’s documents to an Elasticsearch mapping. For now i have a webdav based indexer that will use webhooks to be triggered and otherwise it will run with a cron like timing. But i heard that theres is an api from the fulltextsearch. So i wonders what would be the best way to do that.

The mappings i need to use :

{
    "mapping": {
        "properties": {
            "display_name": {
                "type": "text",
                "fields": {
                    "keyword": { "type": "keyword" }
                }
            },
            "basename": {
                "type": "text",
                "fields": {
                    "keyword": { "type": "keyword" }
                }
            },
            "extension": { "type": "keyword" },
            "display_name_sat": { "type": "search_as_you_type" },
            "path": {
                "type": "text",
                "fields": {
                    "keyword": { "type": "keyword" }
                }
            },
            "path_text": { "type": "text" },
            "description": { "type": "text" },
            "content": { "type": "text" },
            "profile": { "type": "keyword" },
            "app_id": { "type": "keyword" },
            "tenant_id": { "type": "keyword" },
            "mimetype": { "type": "keyword" },
            "last_modified": { "type": "date" },
            "last_opened_at": { "type": "date" },
            "mount_type": { "type": "keyword" },
            "file_id": { "type": "integer" },
            "click_count": { "type": "long" },
            "popularity": { "type": "float" },
            "content_hash": { "type": "keyword"},
            "tags": {
                "properties": {
                    "ids": { "type": "keyword" },
                    "normalized": {
                        "type": "text",
                        "fields": {
                            "keyword": { "type": "keyword" }
                        }
                    }
                }
            },
            "acl": {
                "properties": {
                    "users": { "type": "keyword" },
                    "groups": { "type": "keyword" },
                    "roles": { "type": "keyword" },
                    "scopes": { "type": "keyword" }
                }
            }
        }
    }
}

The content and tags part are for other workers in my data pipeline to feed.

Thanks in advance