All initial indexing done by the plugin is triggered by users viewing the related graph for the first time. Then subsequent indexing is done by user activity on the repository. 

Sometimes it's required to do cleanup and re-index a repository from scratch. There is no such option in user interface but the REST API can be used.

Here is an example using the curl command

curl --user admin:admin -H 'Content-Type: application/json' -v  -X PUT 'http://{BITBUCKET_SERVER_URL}/rest/commitgraph/1.0/projects/{PROJECT_KEY}/repos/{REPOSITORY_SLUG}/index'
BASH

API is available for admin users only. You will need to specify user credentials, server url, project key and repository slug.