views – Search api Solr add fulltext search fields programmatically


I need to change fields in fulltext search fields programmatically.

I try this codes but nothing change:

function MY_MODULE_search_api_solr_query_alter(SolariumQueryInterface $solarium_query, QueryInterface $query) {

    $fields = $query->getFulltextFields();
    $fields() = 'field_competitor_code';

}

or this:

function MY_MODULE_search_api_solr_query_alter(SolariumQueryInterface $solarium_query, QueryInterface $query) {

    $query->setFulltextFields(('title_1', 'field_competitor_code'));

}

How can achieve this change?

Thanks in advance.

F.