Forums
Home / Plugin: Search with Typesense / Add support for collection prefix
(@oarnarsson)
2 years, 7 months ago
Would it be possible to add support for a collection prefix string. So that collections would be named “$prefix . $name”.
Edit: This can be done using the cm_typesense_schema filter.
cm_typesense_schema
(@digamberpradhan)
Hi @oarnarsson ,
Glad you could figure things out, for future reference if anyone else ends up here, this can be achieved by adding the following code
/*Add custom prefix*/ function cmswt_add_schema_prefix($schema){ $schema['name'] = 'my_unique_prefix_name_' . $schema['name']; return $schema; } add_filter( 'cm_typesense_schema', 'cmswt_add_schema_prefix' ,20 );