My site uses Search API and Facet API for search.
My user search has several entity references that are also indexed. So, when just two facets are activated, this gives me a URL like this:
http://www.example.com/search&f1=field_acc_gen%253Afield_location_taxonomize_terms%3A885&f2=field_acc_gen%253Afield_languages%3A50
This is way too long. What I'd like to do is collapse the field_acc_gen%253Afield_location_taxonomize_terms
to co
(country) and field_acc_gen%253Afield_languages%3A50
to la
(language).
I know that Facet API Pretty Paths can be used to shorten the URLs but because I have about 20 facets, the regex that it uses seems to really kill performance. I am also thinking about using Search API Page, which does not work with FacetAPI Pretty Paths. So, I was hoping to find a way to rename the facets themselves in code.
I have my facets exported using the Features module. I tried changing $facet->name
, but this had no affect on the results:
$facet->name = 'search_api@om_user_search::field_acc_gen:field_language';
$facet->searcher = 'search_api@om_user_search';
$facet->realm = '';
$facet->facet = 'field_acc_gen:field_language';
to:
$facet->name = 'search_api@om_user_search::la';
How can I programmatically rename a facet?