0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.