backdrop-contrib / search_api

Provides a generic API for modules offering search capabilities
GNU General Public License v2.0
0 stars 6 forks source link

Convert configuration in tables to config files #41

Open herbdool opened 1 year ago

herbdool commented 1 year ago

I just realized all the indices are stored in tables so it's hard to deploy.

A start would be to start with search_api_index and search_api_server tables which appear to be tables set up with ctools for exporting/importing in d7. (Same for facet_api table).

It could get complicated with the search_apidb* tables which need to be recreated if deployed.

herbdool commented 1 year ago

Now I'm not so sure. The indices are entities which means they are available to Views. So they might need to stay as entities and stored in the database. Perhaps instead there could be a way to export/import the indices. Maybe the solution for Rules is an option.

argiepiano commented 1 year ago

These two entity types (search_api_index and search_api_server) are "configuration entities" provided by Entity Plus and they are exportable "out of the box". Create a search_api_index and try the following:

$i = entity_load('search_api_index', 1);
$c = entity_get_controller('search_api_index');
dpm($c->export($i));

You'll get a JSON output.

It's possible to access this export through a UI - you have to enable Entity UI and then modify the entity definition to indicate a path.

herbdool commented 6 months ago

The holy grail is to have them as Config objects though, I think. Then get all the benefits of regular config objects.