How to manipulate instantsearch by attribute from outside

I want to filter my instantsearch results with atrributes by clicking the button. So i write this:

const searchClient = algoliasearch(algoliaAppId, algoliaApiKey)

const search = instantsearch({
  indexName: trainingSearchIndex,
  searchClient,
  insights: true,
  routing: true,
})

search.addWidgets([
  trainingItems({
    container: '.training-listing',
  }),
])

search.start()

document.querySelector('.my_button').addEventListener('click', function () {
  search.helper.setQuery('myAttribute').search()
})

But it is working like a normal search. I want to filter results with myAttribute value. How can i do this? I can not any document.

I tried this:

document.querySelector('.my_button').addEventListener('click', function () {
  search.helper
    .clearRefinements()
    .addFacetRefinement('trainings.name', 'myAttribute')
  search.helper.search()
})

But it gives this error: trainings.name is not defined in the facets attribute of the helper configuration